Skip to content

feat: SDK 0.9.0 upgrade, ktlint enforcement, session tracking, and prefix lookup fix#72

Closed
jpicklyk wants to merge 16 commits intomainfrom
pr/sdk-upgrade-linting-prefix-fix
Closed

feat: SDK 0.9.0 upgrade, ktlint enforcement, session tracking, and prefix lookup fix#72
jpicklyk wants to merge 16 commits intomainfrom
pr/sdk-upgrade-linting-prefix-fix

Conversation

@jpicklyk
Copy link
Owner

@jpicklyk jpicklyk commented Mar 9, 2026

Summary

  • MCP Kotlin SDK 0.9.0 upgrade — adopts ClientConnection, kotlin-sdk-testing, and new transport APIs
  • ktlint linting — Gradle integration with .editorconfig, CI enforcement in test workflow, full codebase reformatting
  • Session tracking via distributed notes — replaces monolithic session manifest with per-item session-tracking notes enforced by schema gates
  • Schema improvements — role validation in AdvanceItemTool, feature-task schema for lighter child gates, cascade-to-TERMINAL gate enforcement
  • Short UUID prefix lookup fixCAST(blob AS VARCHAR) produced raw bytes in SQLite; switched to LOWER(HEX(id)) for correct BLOB-to-hex conversion
  • Test infrastructure — shared TestBase, fixtures, and helpers extracted for consistent test setup
  • Retrospective improvements — broader terminal-transition nudge coverage, robustness fixes

Test plan

  • All 1240+ tests pass (./gradlew :current:test)
  • CI workflow runs ktlint check before tests
  • Short UUID prefix lookup verified against live SQLite database
  • Session tracking notes enforced at gate transitions

🤖 Generated with Claude Code

jpicklyk and others added 16 commits March 8, 2026 12:30
Introduces structured post-implementation analysis — a /session-retrospective
skill that evaluates schema effectiveness, delegation alignment, note quality,
plan-to-execution fit, and friction across five dimensions. Includes run manifest
instructions in the shared orchestrator output style for durable session telemetry,
and a retrospective nudge after implementation completions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address issues found during skill review: remove hardcoded absolute
paths, add early exit for empty sessions, expand trigger description,
simplify terminal advancement, and add recency filter to fallback mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Cascade auto-completion previously bypassed gate enforcement, allowing
parent items with schema tags to reach TERMINAL with required notes
unfilled. Now cascade-to-TERMINAL checks all required notes (matching
the "complete" trigger behavior). Schema-free parents cascade freely.

Also extracts buildMissingNotesArray() to NoteSchemaJsonHelpers and
replaces inline filledKeys computation with buildFilledKeys() across
all three gate-check paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update the /implement skill to reflect the local-first git workflow:
branches stay local, squash-merge into local main, and PRs are batched.
Align CLAUDE.md git workflow section to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tion

- Add VALID_SCHEMA_ROLES validation in YamlNoteSchemaService.parseEntry()
  to catch typos and invalid role values at config load time (warns + skips)
- Consolidate AdvanceItemTool response fields to use shared
  computePhaseNoteContext() instead of manual NoteSchemaJsonHelpers calls
- Remove findGuidancePointer() and buildNoteProgress() from
  NoteSchemaJsonHelpers (now gate-check helpers only)
- Add plugin-change schema to config.yaml (gitignored, local only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s, and helpers

Add reusable test utilities under current/src/test/.../test/:
- TestFixtures.kt: makeItem(), blocksDep(), makeNote(), JSON param helpers, response extractors
- BaseRepositoryTest.kt: H2 in-memory DB base class with createPersistedItem/Note/Dependency
- MockRepositoryProvider.kt: MockK-based RepositoryProvider factory with context() builder
- TestNoteSchemaService.kt: In-memory NoteSchemaService with FEATURE_IMPLEMENTATION/BUG_FIX presets
- TestInfrastructureTest.kt: 27 validation tests covering all shared infrastructure

Migrated SQLiteWorkItemRepositoryTest to extend BaseRepositoryTest as proof of concept.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The retrospective nudge previously only fired after complete_tree, missing
single-item runs that reach terminal via advance_item. Updated the nudge
condition to trigger on any terminal transition during an /implement run,
with single-item, multi-item, and fallback detection rules.

Also: minor AdvanceItemTool optimization — derive existingKeys from
notesByKey instead of a separate .map() pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The monolithic run manifest (stored as a CC session task) had a 100%
creation failure rate. Replace it with distributed `session-tracking`
notes on each work item, enforced by schema gates.

- Add default schema fallback to YamlNoteSchemaService (one-line change)
- Add session-tracking note to feature-implementation, bug-fix, and
  plugin-change schemas in config.yaml
- Create new `default` schema as catch-all for untagged items
- Rewrite session-retrospective skill to aggregate distributed notes
- Remove manifest section from workflow-orchestrator output style
- Add lightweight delegation-metadata pattern for orchestrator-side data
- Simplify retrospective nudge (remove manifest references)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split feature work into two schema tiers: feature-implementation for the
parent container (full spec, holistic review with /simplify) and feature-task
for child work items (task-scope, task-level review). Plugin skills updated
to remain generic — they reference config.yaml for schema discovery rather
than hardcoding specific tag names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…CI enforcement

Add ktlint (v12.1.2, engine v1.5.0) via jlleitschuh/ktlint-gradle plugin for
automated Kotlin code style enforcement. Includes .editorconfig with wildcard
import allowlist, disabled trailing comma rules, and 140-char line limit.
CI workflow gets a ktlintCheck step before tests. Applied ktlint formatting
across ~108 source files (mechanical whitespace/blank line changes only).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CAST(blob AS VARCHAR) produces raw bytes in SQLite, not a formatted UUID
string, causing prefix lookups to always return empty results. Switch to
LOWER(HEX(id)) for SQLite and LOWER(RAWTOHEX(id)) for H2, which both
produce dashless lowercase hex strings suitable for LIKE prefix matching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jpicklyk jpicklyk closed this Mar 9, 2026
@jpicklyk jpicklyk deleted the pr/sdk-upgrade-linting-prefix-fix branch March 9, 2026 17:40
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