Skip to content

refactor: dedup diff walking, typed tool inputs, TUI case extraction, lock drift check - #319

Merged
Patel230 merged 1 commit into
mainfrom
fix/all-remaining-slice1
Sep 15, 2026
Merged

Patel230 merged 1 commit into
mainfrom
fix/all-remaining-slice1

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Bounded slice of the remaining review items. Each is behavior-preserving except one documented line-number fix.

  • engine/diff dedup: splitLinesStaging/computeLCSStaging were byte-identical copies of splitLines/computeLCS — deleted, staging uses the shared versions; local editEntry folded into shared edit. Added tested ParseUnifiedAddedLines/ParseHunkNewStart and routed cmd/pr.go analyzeDiff through them. Behavior note: added-line numbers now follow hunk headers exactly; the old inline walker was off by one after context lines (pinned by new tests in both packages).
  • Tool typing (incremental, additive): new generic DecodeInput[T] for consistent input errors; migrated SleepTool and AskUserQuestionTool to typed Execute + Schema()-backed Parameters() with schema-parity tests. The Tool interface itself is unchanged (142 tools still hand-write schemas — full migration is follow-up work, now with a proven pattern).
  • TUI Update (safe subset): 11 terminal message cases with no shared-tail dependency moved verbatim to cmd/chat_update_system.go as methods; dispatch is one line each. KeyMsg/WindowSizeMsg/spinner.TickMsg/MouseMsg fall through to the shared tail and stay put — extracting them needs a redesign, not a move.
  • Plugin integrity: SkillsLock.Verify/VerifyInstalledSkills detect missing/tampered/unpinned skills; rho doctor surfaces capped warnings. No signature scheme added: manifests carry no signature fields and installs already gate on folder trust + manifest presence + threat scan; true signing needs a key-management design (noted as follow-up).

Verified: go vet ./..., golangci-lint on touched packages (0 issues), go test on cmd, internal/tool, internal/plugin, internal/engine/diff, internal/testaudit, plus check-internal-layer-imports (frontend may import engine/diff as a shared utility).

… lock drift check

- engine/diff: delete byte-identical splitLinesStaging/computeLCSStaging in
  favor of the shared splitLines/computeLCS; fold local editEntry into the
  shared edit type. Add tested ParseUnifiedAddedLines/ParseHunkNewStart and
  route cmd/pr.go analyzeDiff through it (added-line numbers now follow hunk
  headers exactly; old loop was off by one after context lines).
- tool: add generic DecodeInput[T] for consistent input errors; migrate
  SleepTool and AskUserQuestionTool to typed Execute + Schema-backed
  Parameters with parity tests.
- cmd: extract 11 terminal Update cases (no shared-tail dependency) into
  cmd/chat_update_system.go as methods; dispatch stays one line per case.
  KeyMsg/WindowSize/spinner.Tick fall through to the shared tail and stay.
- plugin: add SkillsLock.Verify/VerifyInstalledSkills (missing file, hash
  mismatch, unpinned entry); surface capped warnings in rho doctor. No
  signature scheme: manifests have no signature fields and installs already
  gate on folder trust + manifest presence + threat scan.
@Patel230
Patel230 merged commit 225632d into main Sep 15, 2026
25 checks passed
@Patel230
Patel230 deleted the fix/all-remaining-slice1 branch September 15, 2026 18:43
Patel230 added a commit that referenced this pull request Oct 2, 2026
… lock drift check (#319)

- engine/diff: delete byte-identical splitLinesStaging/computeLCSStaging in
  favor of the shared splitLines/computeLCS; fold local editEntry into the
  shared edit type. Add tested ParseUnifiedAddedLines/ParseHunkNewStart and
  route cmd/pr.go analyzeDiff through it (added-line numbers now follow hunk
  headers exactly; old loop was off by one after context lines).
- tool: add generic DecodeInput[T] for consistent input errors; migrate
  SleepTool and AskUserQuestionTool to typed Execute + Schema-backed
  Parameters with parity tests.
- cmd: extract 11 terminal Update cases (no shared-tail dependency) into
  cmd/chat_update_system.go as methods; dispatch stays one line per case.
  KeyMsg/WindowSize/spinner.Tick fall through to the shared tail and stay.
- plugin: add SkillsLock.Verify/VerifyInstalledSkills (missing file, hash
  mismatch, unpinned entry); surface capped warnings in rho doctor. No
  signature scheme: manifests have no signature fields and installs already
  gate on folder trust + manifest presence + threat scan.
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