Skip to content

Integrate autocomplete improvements while preserving upstream lifecycle - #832

Open
mc-hamster wants to merge 58 commits into
mainfrom
hamster-integration
Open

mc-hamster wants to merge 58 commits into
mainfrom
hamster-integration

Conversation

@mc-hamster

@mc-hamster mc-hamster commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

This PR brings the CoHamster autocomplete improvements back into Cotabby while retaining upstream’s production/dev app identities, signing defaults, Sparkle updater, and development/release lifecycle. The main behavior change is continuity: predictions can stay useful while the user types, accepts a word ending, or commits a correction, rather than repeatedly disappearing and starting over.

It also contributes the native-runtime integration, focus and visual-context fixes, evaluation infrastructure, and recorded experiment evidence used to develop those changes. The PR remains a draft while dependency integration, CI, and release validation are completed.

Prediction, acceptance, and typing continuity

  • Add prediction-ahead behavior for the on-device engines, with a default-on Predict Ahead While Typing setting. Matching typing can consume an in-flight prediction instead of cancelling every request; incompatible edits, field changes, and stale results still invalidate it.
  • Separate generation, delivery waiting, and presentation timing. Typing-cadence tracking delays distracting presentation during a typing burst without treating that delay as a new global generation debounce.
  • Add Suggest while typing a word and Show following words controls. The visible preview can show one word while the active session retains the remaining continuation for later typing or acceptance.
  • Improve dictionary word-prefix completion, typo gating, and continuation after word endings or corrections. A speculative continuation is tied to the exact proposed edit and reconciled against the actual committed text before use.
  • Preserve streaming and accepted tails across compatible input changes; strengthen dismissal memory, request/session reconciliation, and stale-result checks.
  • Repair missing word separators at completion boundaries while preserving meaningful whitespace and indentation. Add regression coverage for acceptance, corrections, rapid typing, and presentation timing.

Native inference and prompt construction

  • Integrate byte-aware token healing so an unfinished word can be retokenized without changing bytes the user already typed. Buffer partial UTF-8 output safely before presenting text.
  • Improve prompt/KV reuse, sampler reset, cancellation handling, and recovery after failed native decoding. The companion native patch supports bounded checkpoint restoration for recurrent, hybrid, and sliding-window models and exposes content-free cache diagnostics.
  • Keep native mutable state serialized and separate from UI-facing runtime state; update the app’s runtime integration and tests around the new APIs.
  • Refine the base-completion prompt, context sanitization, surface metadata, and section budgeting. Keep Apple Intelligence’s continuation demonstration focused on prose rather than injecting a programming example into every writing surface.
  • Present the existing downloadable model tiers as Cotabby Nano, Mini, Base, and Pro without changing their model filenames or download identities.

The native APIs are contributed separately in CotabbyInference PR #14. Until that lands, this PR pins the native source revision, applies patches/cotabbyinference-upstream-pending.patch, and uses an ignored workspace containing the matching package.

Focus, editor compatibility, and conversation isolation

  • Recognize the Codex desktop app’s Chromium-backed editable surfaces and improve focused web-composer resolution.
  • Recognize writable Mail web composers and handle nonbreaking spaces in Mail’s marker-selection path.
  • Refine Accessibility reads, focus/polling signatures, surface-context caching, and suggestion-anchor reuse.
  • Isolate active suggestions, buffered context, and visual-context state when the focused field or conversation changes, including surfaces that reuse their editor element. Add regression tests to prevent another conversation’s text or stale prediction from carrying over.

Visual context and settings

  • Refresh field-scoped screenshot/OCR context without blocking suggestion generation. Retain a usable excerpt while refreshing, expire old excerpts, and reject late captures after focus, permission, or session changes.
  • Improve OCR line geometry and excerpt selection so nearby conversation/document text is prioritized, reading order is preserved, and useful names, numbers, and punctuation survive cleanup.
  • Keep visual context bounded and permission-gated; refresh does not widen the existing endpoint capture limits.
  • Replace the inverse Fast Mode presentation with the positive Use screen context control while preserving the stored preference’s meaning.
  • Add a debug-only setting for development overlays and update settings search, onboarding feature descriptions, menu surfaces, and related tests.
  • Clarify privacy wording: Apple Intelligence and Open Source run locally; explicitly selected endpoints receive the enabled text context. Correct the evaluation tool’s leftover fork-specific model-directory default.

Evaluation tooling, fixtures, and evidence

  • Add isolated suggestion, scripted typing-session, typing-experience, and contextual phrase-prediction evaluations, with scoring tests and regression fixtures, including the 1,337-scenario phrase corpus.
  • Add Python orchestration and analysis for phrase experiments, completion-prefix failures, model discovery/evaluation, and supported-model qualification.
  • Track source/build inputs and package resolution, reject reuse of mismatched builds, retain manifests and failure evidence, and support repeatable screening and validation campaigns.
  • Include benchmark summaries, raw reports, logs, source snapshots, hashes, plots, and reproduction notes for phrase prediction, live typing, model usability, and token healing. Experiment plans/backlogs document hypotheses; they do not imply that every experimental variant was adopted in production.
  • These evaluations are opt-in. Their timing and correctness results are workload/model/hardware-specific, not universal latency guarantees or measured user acceptance rates.

Upstream lifecycle, packaging, and documentation

  • Preserve upstream’s Cotabby and isolated Cotabby Dev targets, bundle identifiers, signing-team defaults and local overrides, model-storage conventions, dev icon, and updater-disable compilation flag.
  • Preserve Sparkle’s version/public-key/feed configuration and the existing release stages: archive/sign, DMG packaging, notarization/stapling, signed appcast/GitHub release/Pages publication, and Homebrew dispatch. Existing release secret names and publishing destinations remain intact.
  • Adapt local build, CI, release, and evaluation entry points to prepare the matching native workspace. Retain safe local signing/staging outside Documents/iCloud, filter process replacement by app identity, and clean checkout-scoped DerivedData.
  • Add Python tooling tests to app CI; retain upstream build/test check names and runner/toolchain policy. Keep XcodeGen as the project source of truth.
  • Include dependency license texts/notices in the app and expand acknowledgements, architecture/source-layout documentation, contributor instructions, release notes, and evaluation guides.
  • Keep one canonical Xcode project and ignore numbered/obsolete fork copies. The final contribution contains no personal Fastlane pipeline, Ruby dependency setup, or fork-specific release workflow. Historical fork release notes and experiment records remain as provenance.

Validation

Local validation of the restored lifecycle and integrated app:

  • Production app: 2,128 tests completed, 17 skipped, zero failures.
  • 87 Python tooling tests passed; strict SwiftLint passed, including the final model-directory/privacy-copy changes.
  • Optimized Cotabby Dev build passed; its separate bundle identity and COTABBY_DEV flag were verified.
  • Universal unsigned production archive passed for arm64 and x86_64. Verified production identity, embedded Sparkle, update feed/public key, and release version/build-number overrides.
  • Workflow YAML/shell syntax, release/Pages secret-name compatibility, Sparkle exact-version check, and deterministic XcodeGen output checked. DerivedData was cleaned.
  • Companion library: 20 tests passed with Qwen and 20 with Gemma, plus deterministic C++ token-healing tests. Its default Xcode-backed runner hit a local Finder-metadata signing error; the documented native SwiftPM runner compiled and executed both complete suites.

At app head f46b0fe, Tests, Lint, and XcodeGen passed; Build failed because workspace dependency resolution omitted the required scheme. Commit 6cbf853 adds the scheme and checkout-scoped DerivedData path to both Build and Release resolution steps. The exact corrected command passes locally. All four checks on 6cbf853 now pass: Build, Tests, Lint, and XcodeGen.

Remaining integration work

  • Land CotabbyInference #14, adopt a compatible upstream package revision, and retire the checked-in patch/workspace override. Verify a fresh clone using the ordinary project-only workflow. The library PR’s CI currently awaits maintainer approval.
  • Resolve the app Build CI failure and obtain passing checks on 6cbf853. Re-run checks after subsequent integration changes.
  • Separate approximately 1.67 million added lines of generated benchmark reports from the functional review while preserving reproducibility and evidence links.
  • Validate signing, notarization, and packaging with upstream’s configured credentials through the existing non-publishing release dispatch. The unsigned archive check does not establish that these external stages work. Pages/Homebrew dispatch and release publication have not been exercised.

RetriggerConfidence Score: 5/5

No new blocking issue was established in the changes since the previous review.

Summary

The PR integrates autocomplete continuity, native inference, focus and visual-context changes, evaluation tooling, and workspace-based build and release preparation. Since the previous review, it tightens prepared-continuation matching at the capture-window boundary and clarifies the endpoint preview’s privacy wording.

Reviews (6) · Last reviewed commit: "Speak only for Cotabby's storage in the ..."

Reworks the local llama runtime to support token-healing replay, operation-scoped cancellation, and cache restoration based on actual native restore success instead of model-family blacklisting. Prompt/request shaping now preserves exact caret whitespace, keeps multiline seam behavior intact, and adds bounded trailing-text context only for local engines (not endpoint payloads). Adds debug-only first-presentation timing, new runtime/streaming/scoring tests, a full typing-session eval suite, and docs/scripts for reproducible eval runs and local CotabbyInference workspace overrides.
This patch upgrades local visual context from a single field capture to a slow refresh loop with field identity checks, engine-specific context limits, and safer prompt budgets. It adds VisualContextExcerptSelector for nearby OCR selection and preserves larger local excerpts without broadening endpoint privacy. It also adds a fixed phrase-prediction benchmark and scoring harness plus coverage tests for screenshot capture, refresh behavior, and request construction.
Upgrade the phrase benchmark from plain next-word replay to 1,337 contextual writing scenarios with synthetic screen/OCR fixtures. The eval now runs paired screen vs. no-screen conditions, records prompt and visual excerpts, reports context lift/regressions, and validates that answers do not leak into context. Also extend the Python runner with balanced sampling, context selection, progress reporting, and updated compare logic, while refreshing docs/tests and ignoring Python cache artifacts.
Adds a new `Cotabby 3.xcodeproj` with shared `Cotabby` and `Cotabby Dev` schemes/workspace metadata. Extends `scripts/phrase_eval.py` with `save-baseline` export support, stronger run validation, safer child-process shutdown handling, and model-name comparison that ignores path differences. Updates phrase-eval docs, adds benchmark baseline documentation, includes a tracked smoke baseline artifact set, and expands CLI tests for baseline export and progress behavior.
Add the Codex Electron bundle identifier to the browser app detector so focus tracking and editor recovery treat the ChatGPT/Codex desktop app like other Chromium-based editors. This keeps accessibility focus detection working for Codex's composer without relying on display-name matching.
Check in new Xcode project files for the CoHamster and Cotabby app variants, including workspace metadata and shared schemes for the main, dev, and McHamster builds. This captures the full target, package, resource, and test wiring so the apps can be opened and built from Xcode with the expected configurations.
Update all GitHub workflows to the newer pinned `actions/checkout` release. Redraw the menu bar hamster as a dedicated 18pt template glyph, regenerate its assets, and adjust the status view to use the native-sized icon with an accessibility label. The asset generator now treats the menu bar icon separately from the full-color brand artwork and supports `--menu-bar-only` for faster iteration.
Debug/Release now use a single CoHamster app identity and scheme setup (with regenerated Xcode project metadata), while debug overlays became a separate development setting from `-cotabby-debug` logging. The suggestion pipeline was hardened to prevent cross-conversation leakage by introducing session identity checks (URL/title/placeholder-aware), replacing process-only matching, removing stale surface caching, and tightening speculative/streamed/acceptance validation. Visual context now expires and invalidates active suggestions safely, and new tests cover conversation isolation, polling signatures, context generation, and settings behavior.
Restart unseen Apple predictions immediately when typing advances, while preserving llama catch-up behavior. Repair missing separators only between known words with a confirmed misspelled join.

Add regression coverage and record live TextEdit measurements: matched median latency 513 to 424 ms and prediction coverage 6/10 to 10/10. Validation: 79 targeted and 757 regression tests passed; build-for-testing succeeded.
Read Debug, Release, and packaging versions from Config/Version.xcconfig. Reject conflicting release arguments and verify the archived bundle version. Include 0.6.5 release notes for the measured prediction improvements.
Introduce automated GGUF qualification tooling, including bounded Hugging Face discovery, staged model screening, and a runner for evaluating installed catalog models through the real Swift replay pipeline. The eval harness now supports custom corpora, prompt/profile variants, runtime checks, signed staged XCTest hosts, and records the effective word-count preset so latency and quality comparisons stay honest. Also adds regression fixtures, tests, documentation, and retained evidence from the 2026-09-25 supported-model usability investigation.
Expand llama token healing from a single token to a bounded word-fragment replay by adding `TokenHealingPlan` and wiring it into `LlamaRuntimeCore`. Update the native inference patch to prefer tokens that cover the full typed prefix, keep single-line replay safe, and preserve exact editor bytes. Add Swift/C++ regression tests, project wiring, and benchmark artifacts documenting the before/after usability gains.
Preserve CoHamster publishing workflow removals and settings search coverage. Regenerate CoHamster project references for the imported font registry and scale tracker.

Validation: build-for-testing passed; 292 selected tests executed with 5 skips and zero failures. SwiftLint unavailable locally.
Fix coordinator test teardown crash and strict lint failures
Comment thread Cotabby/App/Coordinators/Suggestion/SuggestionCoordinator+Continuation.swift Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Review effort: Lite
Findings: 2 High severity · 1 Low severity

Open (3)
What changed in this PR

Integrates autocomplete continuity, native inference updates, focus/visual-context handling, settings, CI workspace preparation, licensing, and evaluation evidence while preserving Cotabby’s upstream lifecycle and identities.

Changes:

  • Adds prediction-ahead, typing continuity, word completion, correction, and presentation-timing behavior.
  • Adds native runtime/token-healing integration with reproducible workspace preparation.
  • Updates visual context, accessibility support, settings, documentation, packaging, CI, and benchmarks.
File Description
THIRD_PARTY_LICENSES.md Updated as part of this pull request.
scripts/​tests/​test_build_and_run.py Updated as part of this pull request.
scripts/​prepare_cotabby_workspace.sh Updated as part of this pull request.
scripts/​dev-setup.sh Updated as part of this pull request.
scripts/​create-inference-workspace.py Updated as part of this pull request.
scripts/​build_test_dmg.sh Updated as part of this pull request.
releases/​README.md Updated as part of this pull request.
releases/​mchamster-0.6.2.3.md Updated as part of this pull request.
releases/​cohamster-0.6.7-beta.1.md Updated as part of this pull request.
releases/​cohamster-0.6.6.md Updated as part of this pull request.
releases/​cohamster-0.6.5.md Updated as part of this pull request.
releases/​cohamster-0.6.4.md Updated as part of this pull request.
releases/​cohamster-0.6.3.md Updated as part of this pull request.
README.md Updated as part of this pull request.
project.yml Updated as part of this pull request.
FAQ.md Updated as part of this pull request.
CotabbyTests/​UI/​SettingsIndexTests.swift Updated as part of this pull request.
CotabbyTests/​TestSupport/​CotabbyTestFixtures.swift Updated as part of this pull request.
CotabbyTests/​Support/​Suggestion/​Streaming/​TypingCadenceTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Suggestion/​Streaming/​SuggestionStreamingStateTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Suggestion/​Streaming/​SuggestionPresentationTimingTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Suggestion/​Session/​SuggestionDismissalMemoryTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Suggestion/​Request/​CaretWordContextTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Spelling/​WordPrefixIndexTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Spelling/​TypoGateTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Runtime/​BundledRuntimeLocatorTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Prompting/​PromptSectionBudgetTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Prompting/​PromptPolicyTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Onboarding/​OnboardingTemplateRecommenderTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Onboarding/​OnboardingTemplateFeatureListTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Input/​MarkerSelectionSynthesizerTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Focus/​FocusedInputPollingSignatureTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Focus/​Applications/​BrowserAppDetectorTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Context/​PromptContextSanitizerTests.swift Updated as part of this pull request.
CotabbyTests/​Support/​Accessibility/​AXHelperTests.swift Updated as part of this pull request.
CotabbyTests/​Services/​Visual/​ScreenshotContextGeneratorTests.swift Updated as part of this pull request.
CotabbyTests/​Services/​Suggestion/​State/​ContextBufferNavigationTests.swift Updated as part of this pull request.
CotabbyTests/​Models/​Suggestion/​SuggestionQualityMetricsStoreTests.swift Updated as part of this pull request.
CotabbyTests/​Models/​Settings/​SuggestionSettingsDomainTests.swift Updated as part of this pull request.
CotabbyTests/​Models/​Settings/​ShortcutConflictTests.swift Updated as part of this pull request.
CotabbyTests/​Models/​Focus/​FocusTrackingModelTests.swift Updated as part of this pull request.
CotabbyTests/​App/​Coordinators/​Suggestion/​SuggestionCoordinatorPredictionTests.swift Updated as part of this pull request.
CotabbyTests/​App/​Coordinators/​Suggestion/​SuggestionCoordinatorAcceptanceTests.swift Updated as part of this pull request.
Cotabby/​UI/​Settings/​Panes/​WritingPaneView.swift Updated as part of this pull request.
Cotabby/​UI/​Settings/​Panes/​ShortcutsPaneView.swift Updated as part of this pull request.
Cotabby/​UI/​Settings/​Panes/​PermissionsPaneView.swift Updated as part of this pull request.
Cotabby/​UI/​Settings/​Panes/​HomePaneView.swift Updated as part of this pull request.
Cotabby/​UI/​Settings/​Panes/​ContextPaneView.swift Updated as part of this pull request.
Cotabby/​UI/​Settings/​Panes/​About/​AcknowledgementsView.swift Updated as part of this pull request.
Cotabby/​UI/​Settings/​Panes/​About/​AboutPaneView.swift Updated as part of this pull request.
Cotabby/​UI/​Onboarding/​Welcome/​WelcomeView.swift Updated as part of this pull request.
Cotabby/​UI/​Onboarding/​Welcome/​WelcomePermissionStepView.swift Updated as part of this pull request.
Cotabby/​UI/​MenuBar/​MenuBarStatusLabelView.swift Updated as part of this pull request.
Cotabby/​Support/​Suggestion/​Streaming/​TypingCadence.swift Updated as part of this pull request.
Cotabby/​Support/​Suggestion/​Streaming/​SuggestionPresentationTiming.swift Updated as part of this pull request.
Cotabby/​Support/​Suggestion/​Streaming/​StreamedGhostTextPolicy.swift Updated as part of this pull request.
Cotabby/​Support/​Suggestion/​Session/​SuggestionDismissalMemory.swift Updated as part of this pull request.
Cotabby/​Support/​Suggestion/​Session/​SpeculativeAcceptanceContext.swift Updated as part of this pull request.
Cotabby/​Support/​Suggestion/​Output/​SuggestionTextNormalizer.swift Updated as part of this pull request.
Cotabby/​Support/​Spelling/​TypoGate.swift Updated as part of this pull request.
Cotabby/​Support/​Spelling/​CurrentWordExtractor.swift Updated as part of this pull request.
Cotabby/​Support/​Runtime/​TokenHealingPlan.swift Updated as part of this pull request.
Cotabby/​Support/​Runtime/​BundledRuntimeLocator.swift Updated as part of this pull request.
Cotabby/​Support/​Prompting/​PromptSectionBudget.swift Updated as part of this pull request.
Cotabby/​Support/​Prompting/​FoundationModelPromptRenderer.swift Updated as part of this pull request.
Cotabby/​Support/​Presentation/​Geometry/​SuggestionAnchorCache.swift Updated as part of this pull request.
Cotabby/​Support/​Onboarding/​OnboardingTemplateFeatureList.swift Updated as part of this pull request.
Cotabby/​Support/​Logging/​CotabbyDebugOptions.swift Updated as part of this pull request.
Cotabby/​Support/​Input/​MarkerSelectionSynthesizer.swift Updated as part of this pull request.
Cotabby/​Support/​Focus/​FocusedInputPollingSignature.swift Updated as part of this pull request.
Cotabby/​Support/​Focus/​Applications/​BrowserAppDetector.swift Updated as part of this pull request.
Cotabby/​Support/​Context/​PromptContextSanitizer.swift Updated as part of this pull request.
Cotabby/​Support/​Context/​OCRTextHygiene.swift Updated as part of this pull request.
Cotabby/​Services/​Visual/​ScreenTextExtractor.swift Updated as part of this pull request.
Cotabby/​Services/​Suggestion/​State/​ContextBuffer.swift Updated as part of this pull request.
Cotabby/​Services/​Spelling/​SymSpellCorrector.swift Updated as part of this pull request.
Cotabby/​Services/​Runtime/​Llama/​LlamaSuggestionEngine.swift Updated as part of this pull request.
Cotabby/​Services/​Presentation/​FocusDebugOverlayController.swift Updated as part of this pull request.
Cotabby/​Services/​Focus/​Chromium/​ChromiumAccessibilityEnabler.swift Updated as part of this pull request.
Cotabby/​Services/​Focus/​Caching/​SurfaceContextCache.swift Updated as part of this pull request.
Cotabby/​Resources/​ThirdPartyLicenses/​SwiftLog-NOTICE.txt Updated as part of this pull request.
Cotabby/​Resources/​ThirdPartyLicenses/​SOURCES.md Updated as part of this pull request.
Cotabby/​Resources/​ThirdPartyLicenses/​Llama.cpp-MIT.txt Updated as part of this pull request.
Cotabby/​Resources/​ThirdPartyLicenses/​LaunchAtLogin-MIT.txt Updated as part of this pull request.
Cotabby/​Resources/​ThirdPartyLicenses/​Gemoji-MIT.txt Updated as part of this pull request.
Cotabby/​Resources/​ThirdPartyLicenses/​CotabbyInference-MIT.txt Updated as part of this pull request.
Cotabby/​Models/​Suggestion/​SuggestionSubsystemContracts.swift Updated as part of this pull request.
Cotabby/​Models/​Suggestion/​SuggestionQualityMetricsStore.swift Updated as part of this pull request.
Cotabby/​Models/​Suggestion/​SuggestionEngineModels.swift Updated as part of this pull request.
Cotabby/​Models/​Suggestion/​Result/​SuggestionResult.swift Updated as part of this pull request.
Cotabby/​Models/​Suggestion/​Request/​SuggestionConfiguration.swift Updated as part of this pull request.
Cotabby/​Models/​Suggestion/​Request/​FocusedInputContext.swift Updated as part of this pull request.
Cotabby/​Models/​Settings/​SuggestionSettingsData.swift Updated as part of this pull request.
Cotabby/​Models/​Runtime/​LlamaRuntimeModels.swift Updated as part of this pull request.
Cotabby/​Models/​Onboarding/​OnboardingTemplate.swift Updated as part of this pull request.
Cotabby/​Models/​Focus/​FocusTrackingModel.swift Updated as part of this pull request.
Cotabby/​Models/​Context/​VisualContextModels.swift Updated as part of this pull request.
Cotabby/​App/​Core/​CotabbyAppEnvironment.swift Updated as part of this pull request.
Cotabby/​App/​Core/​CotabbyApp.swift Updated as part of this pull request.
Cotabby/​App/​Core/​AppDelegate.swift Updated as part of this pull request.
Cotabby/​App/​Coordinators/​Suggestion/​SuggestionCoordinator+Lifecycle.swift Updated as part of this pull request.
Config/​Package.resolved Updated as part of this pull request.
benchmarks/​phrase-prediction/​smoke-14-qwen35-0.8b-q6/​summary.txt Updated as part of this pull request.
benchmarks/​phrase-prediction/​smoke-14-qwen35-0.8b-q6/​manifest.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​RUN_TABLE.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​FULL42_ANALYSIS.md Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​CANDIDATE_PATCHES.md Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​baseline-screen42/​summary.txt Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​baseline-screen42/​resolution.log Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​baseline-screen42/​resolution-inputs.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​baseline-screen42/​metadata.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​baseline-full42/​summary.txt Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​baseline-full42/​resolution.log Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​baseline-full42/​resolution-inputs.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​baseline-full42/​metadata.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​B-screen42/​summary.txt Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​B-screen42/​resolution.log Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​B-screen42/​resolution-inputs.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​B-screen42/​metadata.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​AB-screen42/​summary.txt Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​AB-screen42/​resolution.log Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​AB-screen42/​resolution-inputs.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​AB-screen42/​metadata.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​AB-full42/​summary.txt Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​AB-full42/​resolution.log Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​AB-full42/​resolution-inputs.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​AB-full42/​metadata.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​A-screen42/​summary.txt Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​A-screen42/​resolution.log Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​A-screen42/​resolution-inputs.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round3/​A-screen42/​metadata.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round2/​CLOSURE.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1/​summary.txt Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​validation-window-plan.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​source-prerequisites/​Package.resolved Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​round.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​round-completion.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​registered-decision-criteria.md Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​plot-requirements.txt Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​p2-prompt-delta-audit.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​local-path-repeatability.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​local-execution-migration.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​isolation-source-manifest.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​heldout-baseline-repeatability.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​full42-repeatability.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​final-source-verification.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​criteria-snapshot.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​cleanup.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​round1-20260917/​character150-plan.json Updated as part of this pull request.
benchmarks/​phrase-prediction/​README.md Updated as part of this pull request.
benchmarks/​phrase-prediction/​baseline-v1/​summary.txt Updated as part of this pull request.
benchmarks/​phrase-prediction/​1337-full-20260925/​summary.txt Updated as part of this pull request.
benchmarks/​model-usability/​2026-09-25/​evidence.sha256 Updated as part of this pull request.
benchmarks/​model-usability/​2026-09-25-token-healing/​release-build.json Updated as part of this pull request.
benchmarks/​model-usability/​2026-09-25-token-healing/​evidence.sha256 Updated as part of this pull request.
benchmarks/​live-typing/​2026-09-24-apple-intelligence/​README.md Updated as part of this pull request.
benchmarks/​live-typing/​2026-09-24-apple-intelligence/​manifest.json Updated as part of this pull request.
.gitignore Updated as part of this pull request.
.github/​workflows/​tests.yml Updated as part of this pull request.
.github/​workflows/​release.yml Updated as part of this pull request.
.github/​workflows/​build.yml Updated as part of this pull request.
.github/​PULL_REQUEST_TEMPLATE.md Updated as part of this pull request.
.github/​FUNDING.yml Updated as part of this pull request.
.codex/​environments/​environment.toml Updated as part of this pull request.
.claude/​skills/​ship/​SKILL.md Updated as part of this pull request.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Cotabby/App/Coordinators/Suggestion/SuggestionCoordinator+Lifecycle.swift Outdated
Comment thread scripts/build_test_dmg.sh Outdated
Comment thread THIRD_PARTY_LICENSES.md
Comment thread CotabbyTests/TestSupport/SuggestionCoordinatorTestSupport.swift
@mc-hamster
mc-hamster marked this pull request as draft September 26, 2026 19:58
akramj13 and others added 5 commits September 27, 2026 01:21
Once the exact accepted edit publishes, the host-publish poll stands down and
the prepared continuation alone owns the next prediction. Three paths could
then drop it silently when the editor changed again without a key event:

- the queued apply found the target gone and returned (review P1);
- a continuation finishing after that change stayed buffered and unused;
- a failed continuation waited for yet another edit, then abandoned the field
  at the correction timeout.

Each now falls back to an ordinary prediction for the live text. A field that
AX briefly stops reporting is polled until it returns instead of disabling
suggestions on one transient read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Live testing with Apple Intelligence returned `we've decided to move forward`
directly after "...let you know that". Separator repair only accepted
plain-letter words, so the apostrophe made `thatwe've` a plain seam
misspelling and the whole prediction was suppressed.

Treat a token as a whole word when its apostrophes or hyphens sit between
letters (`we've`, `it's`). A connector at either edge (`'t`, `don'`) is still
a fragment of the word being spelled, so `don` + `'t` is never split, and
streaming still waits for the complete word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PR corrected the Context pane's "How this is used" bullet to say an
endpoint receives the text, but the live preview footer above it still
promised "Nothing here is saved or shared; it only exercises the on-device
model." The preview runs the real pipeline, so with an OpenAI-compatible
endpoint selected (which may be on the LAN or the internet) typed text is
sent there.

Keep the on-device wording for Apple Intelligence and Open Source, and say
the text goes to the configured endpoint when one is selected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a final-chunk or correction accept, a second quick Tab is held until
the continuation appears, then accepts its first word. The window only ended
when the overlay hid, but with no session and an idle state, typing never
hides anything. A Tab pressed before "I" was flushed into the suggestion for
"...I" once it arrived, inserting words the user never saw.

Release the window on every text-changing, navigation, or dismissal key. A
held Tab now only accepts the continuation of the text it was pressed on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Predict-ahead keeps a request alive through matching keys, then shifts its
answer past the typed letters. That shifted text reached presentation without
the checks a fresh request at the new caret gets:

- whitespace alone ("you " after typing "you") became an invisible ready
  session with no request left, so nothing appeared until the next key;
- words that already follow the caret were offered again, and Tab
  duplicated them;
- with "Suggest while typing a word" off, a new offer appeared mid-word.

Final answers that fail these checks now restart the normal pipeline, and
matching partials are skipped. A suggestion already on screen still follows
the user's typing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
akramj13 and others added 6 commits September 27, 2026 02:42
FocusTracker bumps the focus sequence whenever the polling signature changes,
and that signature includes the field's rounded frame. On main a bump only
restarted screen capture, because suggestion identity compared the process
alone. This branch compares the full session identity, sequence included, so
every line wrap in a self-growing composer (chat apps, ChatGPT, long
documents) now counted as navigation: it hid the ghost text, cleared the
anchor cache, reset the model cache, and turned off Tab interception.

A field whose frame changes only by resizing in place (same left edge and
width, with its top or bottom edge unchanged) is now the same field. Distinct
fields stacked in one column still differ at both edges, and the URL, title,
and placeholder navigation facts are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two paths could run automatic correction on text outside the current edit:

- After a replacement, the publication poll must wait for new text so stale
  AX cannot correct the same word twice. Selection changes were excluded,
  but a recycled Chromium AX wrapper still counted, so the typo gate ran on
  the unpublished word and turned "word " into "wword " (reachable when no
  prepared continuation is waiting, e.g. with an endpoint engine).
- A focus change during an in-flight generation scheduled a prediction for
  whatever field gained focus. Clicking into another field could then replace
  an old typo there, which the adjacent comment says must not happen.

Only a text change now ends a post-replacement poll. After a focus change,
lookahead resumes only when the same writing continues (same text around the
caret); another field waits for real input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Focus capture keeps only the last 4096 UTF-16 units before the caret, so an
edit that changes length slides that window. A prepared continuation's
target was the source window plus the edit, compared by exact content
signature, so in long documents it never matched. The publication poll then
ignored every change until its 400 ms ceiling: accepted word endings waited
the full ceiling for their next words, and accepted corrections ended with no
suggestion at all.

Also accept the slid window when one window ends with the other, the live
window is at least as long as the source, and the text after the caret is
unchanged. Field identity, selection, and secure-field checks are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the caret sits inside a word ("the|me"), Cotabby asks llama to forbid a
whitespace-leading first token so the insertion joins both halves. Token
healing now replays the whole last word, and the runtime disabled that mask
whenever a healed prefix existed. The native engine lifts the mask during the
replay and never restores it for the next token, so the suggestion could
begin with " meeting" and render as "the meetingme".

Skip healing only when mid-word continuation is forced. Those requests keep
the pre-healing behavior; ordinary end-of-word prompts still heal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build_and_run.sh:
- Build into a private DerivedData directory. The EXIT trap removed the
  shared build/DerivedData on every run, including early failures, deleting
  products that tests, evals, or another build were using.
- Accept an ad-hoc signed installed app. Without an Apple Development
  certificate codesign prints no Authority and an implicit cdhash
  requirement, so every run after the first stopped with "Cannot determine
  installed app signing identity".
- Stage the runnable app under the dev app's "Cotabby Dev" support folder
  instead of the production app's "Cotabby" folder.

prepare_cotabby_workspace.sh:
- Pin the diff format so settings such as diff.noprefix or an external diff
  cannot make a pristine checkout look modified.
- Explain a stale checkout (a bumped revision or edited patch) instead of
  exiting silently under set -e; it is still never reset automatically.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without --workspace the phrase eval built Cotabby.xcodeproj, which resolves
the remote CotabbyInference. The app now calls APIs that exist only in the
pinned, patched checkout, so the documented commands failed to compile.
Default to build/cotabby-dependencies/Cotabby.xcworkspace, as the supported
model eval already does, and point to the prepare script when it is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akramj13
akramj13 requested a lite review from Copilot September 27, 2026 07:17
@akramj13
akramj13 marked this pull request as ready for review September 27, 2026 07:17
Comment thread Cotabby/Support/Suggestion/Session/SuggestionContinuationPlan.swift Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The scope is broad, with unresolved correctness concerns and pending native dependency, signing, packaging, and release validation.

Review effort: Lite
Findings: 1 High severity · 1 Low severity

Open (2)
Resolved since last review (3)

Comment thread Cotabby/UI/Settings/Panes/ContextPaneView.swift Outdated
akramj13 and others added 2 commits September 27, 2026 03:26
The long-field match accepted any live text that ended with the prepared
target (or vice versa). That also applied to fields that fit entirely in the
capture window, where the host adding or removing text before the edit is a
real change: a continuation prepared for the old text could still be shown.

Only accept a slid window when both the source and the live window were cut
to the capture limit, so any remaining difference lies before both windows,
in text the prepared request never saw. Shorter fields keep the exact
signature check. The limit now lives on FocusedInputSnapshot so the pure plan
does not reach into the focus resolver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Nothing here is saved" read as a promise about the configured server too,
which Cotabby cannot make. Say that Cotabby doesn't save the preview text,
and that the endpoint receiving it may keep it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

3 participants