Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
2956939
Add TurboQuant Wave 0 control contracts
May 25, 2026
3f97958
Resolve TurboQuant Wave 0 blockers
May 25, 2026
afe8c1e
Update TurboQuant compatibility pair handoff
May 25, 2026
c80ec2a
Add TurboQuant Wave 1 control plane
May 25, 2026
ec2e1b8
Update TurboQuant Wave 1 handoff notes
May 25, 2026
a1cdcb4
Integrate TurboQuant Wave 2 runtime bridge
May 25, 2026
876d477
Record TurboQuant Wave 2 handoff
May 25, 2026
5266cd7
Harden Wave 2 admission metadata
May 25, 2026
f5a554a
Finalize TurboQuant Wave 2 handoff metadata
May 25, 2026
8d374ef
Harden TurboQuant Wave 2 runtime admission
May 25, 2026
6a26718
Implement TurboQuant Wave 3 evidence loop
May 25, 2026
e94d180
Close TurboQuant Wave 3 evidence audit gaps
May 25, 2026
f001c8a
Implement TurboQuant Wave 4 context persistence
May 25, 2026
bde64e2
Gate TurboQuant Wave 5 optimization evidence
May 25, 2026
fdf6593
Add TurboQuant speculative runtime gates
May 25, 2026
d35e685
Document Wave 6 test serialization hardening
May 25, 2026
34feba2
Implement Wave 7 platform unlock contracts
May 25, 2026
b410ae9
Harden Wave 7 platform evidence and snapshots
May 25, 2026
7c33709
Promote TurboQuant Wave 7 MLX production pins
May 25, 2026
11844e2
Record Wave 3.5 promotion manifest commit
May 25, 2026
e710f7a
Promote release-green TurboQuant pins
May 25, 2026
4d9d89e
Mark TurboQuant compatibility pair green
May 25, 2026
83f31d0
Update release-green TurboQuant documentation
May 25, 2026
9204465
Pin Layout V5 default MLX pair
May 25, 2026
32e9ca9
Host Pines unit tests for device runs
May 25, 2026
4cac4b0
Enable TurboQuant runtime support for profile families
May 25, 2026
9d99174
Broaden TurboQuant model support in Pines
May 25, 2026
f9d6bcd
Consume MLX TurboQuant capability registry
May 25, 2026
ea6f700
Consolidate artifacts UI components
May 25, 2026
f2f3663
Update artifacts surface contract
May 25, 2026
00bb2fa
Fix TurboQuant model admission regressions
May 25, 2026
c686b15
Stabilize TurboQuant dense Qwen runtime support
May 26, 2026
7f04583
Stabilize quality-sensitive TurboQuant profiles
May 26, 2026
73c5c76
Pin Pines to corrected TurboQuant profiles
May 26, 2026
17d9b4a
Pin Pines to guarded TurboQuant pair
May 26, 2026
17fff9c
Make iOS stress builds noninteractive
May 26, 2026
a9a532e
Pin Pines to guarded TurboQuant lower-bit runtime
May 26, 2026
0a3883e
Document latest TurboQuant device evidence
May 26, 2026
4e2394b
Route short local runs away from TurboQuant
May 26, 2026
eca4cc3
Pin Qwen TurboQuant proof runtime
May 26, 2026
fc40178
Pin hardened Qwen TurboQuant runtime
May 26, 2026
2a7f3c2
Pin runtime layout TurboQuant kernels
May 26, 2026
eebe884
Pin TurboQuant Qwen production path
May 26, 2026
b317846
Pin TurboQuant fused bit path proof
May 26, 2026
518a4f3
Promote fused TurboQuant proof pins
May 26, 2026
4f50d0e
Pin grouped-query TurboQuant proof pair
May 26, 2026
9448b11
Pin optimized TurboQuant Mac proof pair
May 26, 2026
e05d855
Pin optimized TurboQuant Qwen proof pair
May 26, 2026
fe470cd
Pin optimized TurboQuant tuning pair
May 26, 2026
82390e4
Pin Layout V6 TurboQuant proof pair
May 27, 2026
f130935
Pin fused-partial TurboQuant proof pair
May 27, 2026
bac0428
Pin adaptive raw-first TurboQuant routing
May 27, 2026
7d12e33
Dynamic FP16↔TurboQuant KV decision + bump mlx pins
May 30, 2026
e7beefb
Bump mlx-swift-lm pin to a6e9448 (3A-a in-place cache donation)
May 30, 2026
2bd692a
Bump mlx-swift-lm pin to fe1c35c (4.1 fp16 fallback + 2A mid-gen spill)
May 30, 2026
e4d9e99
Bump mlx-swift-lm pin to 3118d5b (turbo3 cleanup + A-series harness)
May 30, 2026
1f3cbc4
Wire Pines TurboQuant evidence gates
May 31, 2026
679473b
Pin hybrid TurboQuant native diagnostics pair
May 31, 2026
54df79b
Require real model TurboQuant evidence
May 31, 2026
7184d0e
Pin affine K8 V4 MLX pair
Jun 1, 2026
c95ce29
Record affine K8 V4 compatibility app commit
Jun 1, 2026
d336b81
Pin TurboQuant pipeline cleanup pair
Jun 1, 2026
e712530
Record TurboQuant cleanup compatibility app commit
Jun 1, 2026
4722f57
Document TurboQuant speed memory baseline
Jun 1, 2026
5341015
TurboQuant: checkpoint in-progress evidence/control-plane work + docs
Jun 7, 2026
235086e
docs: record pending N2 self-speculation + N4 codec upstream adoption
Jun 7, 2026
ebc1d80
turboquant(debug): on-device real-model TurboQuant benchmark hook
Jun 13, 2026
43358b7
Complete Pines hardening and exact-pair validation
Jul 12, 2026
4af4869
Fix PR-wide repository hygiene
Jul 12, 2026
8b4718b
Finalize compatible MLX pins and interaction tuning
Jul 12, 2026
3014cab
Keep memory zone validation compiler-friendly
Jul 12, 2026
c851026
Harden CodeQL Metal tool preparation
Jul 12, 2026
d3b7c21
Harden provider editing and routing controls
Jul 12, 2026
19d1023
Harden hosted simulator validation
Jul 12, 2026
ddfe260
Upgrade public website experience
Jul 12, 2026
a1eda40
Complete end-to-end iOS design upgrade
Jul 12, 2026
24b035f
Merge pull request #20 from RNT56/codex/ios-design-completion
RNT56 Jul 12, 2026
aaeb9cc
Add OpenRouter route and cost receipts
Jul 12, 2026
2de9661
Add capability-driven OpenRouter catalog
Jul 13, 2026
156e742
Persist fresh cloud model catalogs
Jul 13, 2026
878ca5d
Add OpenRouter server web search
Jul 13, 2026
8ac96a1
Merge pull request #14 from RNT56/tq/real-device-evidence-acceptance
RNT56 Jul 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ jobs:
- name: Install site dependencies
run: npm --prefix site ci

- name: Audit site dependencies
run: npm --prefix site audit --audit-level=low

- name: Build site
run: npm --prefix site run build

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ jobs:
- name: Install site dependencies
run: npm --prefix site ci

- name: Audit site dependencies
run: npm --prefix site audit --audit-level=low

- name: Build site
run: npm --prefix site run build

Expand Down
33 changes: 23 additions & 10 deletions DEV_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is the technical handbook for Pines. The main [README](README.md) is user-facing; this file is for people building, auditing, extending, or performance-tuning the app.

Pines is a source-available iOS 26 AI workbench built around local MLX Swift inference, BYOK cloud routing, private vault context, MCP Streamable HTTP, policy-gated tools, GRDB persistence, optional CloudKit sync, Watch support, and pinned Schtack-maintained MLX forks.
Pines is a source-available iOS 17+ AI workbench built around local MLX Swift inference, BYOK cloud routing, private vault context, MCP Streamable HTTP, policy-gated tools, GRDB persistence, optional CloudKit sync, Watch support, and pinned Schtack-maintained MLX forks.

## Fast Path

Expand Down Expand Up @@ -31,8 +31,8 @@ Project generation is pinned through `scripts/ci/xcodegen.sh` to XcodeGen `2.45.

## Platform And Toolchain

- App deployment target: iOS `26.0`.
- Watch target deployment: watchOS `26.0`.
- App deployment target: iOS `17.0`.
- Watch target deployment: watchOS `10.0`.
- Xcode project source of truth: `project.yml`.
- Generated project: `Pines.xcodeproj`, committed and drift-checked.
- Swift package tools version: Swift `6.2`.
Expand Down Expand Up @@ -115,7 +115,7 @@ Provider lifecycle records are generic on purpose. OpenAI Files/vector stores, A

## Persistence And Sync

The local store is GRDB/SQLite. Schema source of truth is `Sources/PinesCore/Persistence/DatabaseSchema.swift`; the current schema version is `12`.
The local store is GRDB/SQLite. Schema source of truth is `Sources/PinesCore/Persistence/DatabaseSchema.swift`; the current schema version is `26`.

When changing persistence:

Expand All @@ -128,7 +128,9 @@ When changing persistence:
- Add indexes for list, sync, search, and vector-scan paths before the UI depends on them.
- Update core tests or `PinesCoreTestRunner` for schema contract changes.

CloudKit is optional and private-database scoped. Do not sync API keys, model binaries, prompt caches, generated embeddings/vector codes by default, transient browser/tool state, or local chat attachment files. Generated embeddings and compressed vector codes sync only when private iCloud sync and the separate embedding sync toggle are both enabled.
CloudKit is optional and private-database scoped. It synchronizes settings, Project Spaces, conversations/messages, and enabled Vault metadata/chunks through encrypted payload records; project tombstones unlink child chat and Vault records on peers. Do not sync API keys, model binaries, prompt caches, TurboQuant KV snapshots, generated embeddings/vector codes by default, transient browser/tool state, or local chat attachment files. Generated embeddings and compressed vector codes sync only when private iCloud sync and the separate embedding sync toggle are both enabled.

The app model owns one observable CloudKit sync status with the current phase, last attempt, last success, redacted error, and trigger. Settings exposes that state and a bounded manual retry. A successful transport/merge run is not evidence that user-visible conflict resolution is complete; conflict persistence and resolution UI remain separate product work.

Personal Apple Developer accounts are safe by default. `PINES_CODE_SIGN_ENTITLEMENTS` and `PINES_ICLOUD_SWIFT_FLAGS` are empty in `project.yml`, so Xcode does not request iCloud provisioning. Paid-team CloudKit builds must override both:

Expand Down Expand Up @@ -157,6 +159,8 @@ Hard requirements:
- Local vault and MCP resource context must require per-turn approval before entering a cloud request.
- Provider-hosted files, caches, vector stores, batches, generated artifacts, live/realtime sessions, research runs, token counting, and hosted tools must be labeled as cloud/provider resources and kept distinct from local Vault data.
- Browser, web, and MCP outputs are untrusted model context.
- Arbitrary web fetch/browser top-level URLs must pass the public-host gate; web fetch also validates resolved addresses, redirects, and final URLs.
- Finite provider, MCP, OAuth, Brave Search, and credential-validation response bodies must use `BoundedHTTPResponse` limits rather than unbounded `URLSession.data(for:)` ingestion.
- Browser automation must require visible approval for login, checkout, posting, upload, credential-adjacent, and remote-state-changing actions.
- Tool execution is deny-by-default and must pass `ToolPolicyGate`.

Expand All @@ -175,6 +179,8 @@ Performance-sensitive work must respect iOS memory pressure, thermal state, Low

TurboQuant is the requested default local KV-cache strategy. Pines requests the `metalPolarQJL` backend by default, reports requested/active backend and attention path diagnostics, and falls back to MLX packed attention when required by device capability or shape.

The production bridge performs request-scoped local admission before generation. It records the admitted context, memory zones, fallback contract, context assembly plan, RunDecision, calibration sample, and explicit no-cloud-fallback metadata. `compatibility-pair.json` may be green for the pinned runtime pair while model/device/mode compatibility remains unverified; product `Verified` and `Certified` labels require matching real-device evidence.

Device profile defaults from `DeviceProfile`:

| Profile | Max model bytes | Context | Small-model context | Prefill | Embedding batch | Vector scan | Vision |
Expand Down Expand Up @@ -213,27 +219,30 @@ Current app-level limits and defaults:
- Chat attachments are capped at eight files per draft.
- MCP decoded blob previews are capped at `10 MB`.
- MCP text output passed back to model context is capped in service code.
- Provider JSON responses are capped at `32 MB`, ordinary file/audio/batch downloads at `64 MB`, and generated video at `512 MB`.
- Default agent policy: `8` steps, `6` tool calls, `120` seconds wall time.
- Normal chat does not advertise every registered tool; Agent mode and MCP sampling have separate policy gates.

## MLX Fork Pins

The iOS app links exact maintained MLX fork revisions through `project.yml` and the generated Xcode project:

- `MLXSwift`: `https://github.com/RNT56/mlx-swift` at `a90b1097df45e4e70b6e0bb367624f8f5857970b`
- `MLXSwiftLM`: `https://github.com/RNT56/mlx-swift-lm` at `af28d8a0e28a5f7d8a012ed66a1470ac00c6f20c`
- Nested `mlx` inside `MLXSwift`: `3eb8ef074b911b00ecdbeb47f7bdafd91a123ad0`
- Nested `mlx-c` inside `MLXSwift`: `2abc34daff6ded246054d9e15b98870b5cd08b97`
- `MLXSwift`: `https://github.com/RNT56/mlx-swift` at `bcf93af23f11428f6f01efb0bb4b9020cd2eb383`
- `MLXSwiftLM`: `https://github.com/RNT56/mlx-swift-lm` at `aeaa8e3024a82b25969741b53c749b28ddc64d1a`
- Nested `mlx` inside `MLXSwift`: `e230d124a1fdcb5f4b3daab6321744a7a8b6a9f2`
- Nested `mlx-c` inside `MLXSwift`: `2fbeccd5a6ec6f7aadedaf1d3dfb2894ef44fbc1`

These pins are intentional because Pines consumes additive TurboQuant and compatibility APIs not assumed to exist in upstream package releases yet.

The active TurboQuant compatibility pair is recorded in `docs/turboquant-implementation/compatibility-pair.json`. A `green` pair means the pinned runtime pair passed local release gates; it is not a substitute for real-device profile evidence.

Use the helper to move pins:

```sh
tools/update-mlx-pins.sh
```

CI checks that `project.yml` and `Pines.xcodeproj` agree, that pins are not below known-good minimums, that obsolete revisions are absent, and that nested `mlx`/`mlx-c` revisions match expectations. Do not edit Xcode DerivedData package checkouts.
CI checks that `project.yml`, `Pines.xcodeproj`, the Xcode package lockfile, `docs/TURBOQUANT.md`, `compatibility-pair.json`, and `MLXRuntimeBridge.turboQuantCompatibilityPairID` agree; that pins are not below known-good minimums; that obsolete revisions are absent; and that nested `mlx`/`mlx-c` revisions match expectations. Do not edit Xcode DerivedData package checkouts.

## Model Discovery And Downloads

Expand Down Expand Up @@ -347,6 +356,9 @@ When adding or changing a provider:
- Parse provider metadata without leaking keys or raw sensitive payloads into logs.
- Add tests for stream parser edge cases.
- Keep cloud route selection explicit through `ExecutionRouter`.
- Preserve provider identity and Keychain account when editing display names or endpoints; blank replacement credentials must retain the existing secret.
- Keep OpenRouter routing policy typed and normalized. Schema/tool-critical requests must set `require_parameters`, and privacy restrictions must never be silently relaxed.
- Finalize streamed provider metadata only after the terminal accounting chunk. Persist only the OpenRouter receipt allowlist (route/provider/model/status, usage, and cost), never arbitrary router pipeline/plugin payloads.

## Vault And Retrieval

Expand Down Expand Up @@ -399,6 +411,7 @@ MCP rules:
- Binary resource MIME types must be allowlisted.
- Sampling runs only when enabled for the server and approved by the user.
- MCP sampling may use BYOK only when BYOK sampling is enabled for that server.
- Persist MCP tool safety annotations and treat unannotated tools as remote-state-changing.
- Global chat execution mode is not implicitly reused for sampling.
- Pines does not currently advertise MCP roots.

Expand Down
Loading
Loading