Skip to content

fix: fold the six review items #193–#209 left on the floor - #211

Merged
kpmmmurphy merged 1 commit into
masterfrom
fix/review-sweep-2026-09-05
Sep 5, 2026
Merged

fix: fold the six review items #193–#209 left on the floor#211
kpmmmurphy merged 1 commit into
masterfrom
fix/review-sweep-2026-09-05

Conversation

@kpmmmurphy

Copy link
Copy Markdown
Contributor

What

A sweep of the review comments on #193#209: six flagged items were never folded. This lands them in one PR.

# Source Fix
1 #193 review 2 iOS Grounding footer overclaimed. "The only thing that reaches the internet" was false: brain and M1K3 Voice weight downloads reach the internet too. Now "The only thing that sends your conversation to the internet." (reviewer's wording).
2 #207 code-quality bot feedback_to_fixtures.py read the JSONL with a bare open().read(); now a context manager.
3 #209 review 2 fallbackPrompt filtered the trace twice with an identical predicate (observations + pageRead). One survivors collection now feeds both, so they cannot desync.
4 #209 review 2 A long <meta description> could consume the whole observation cap and leave zero page text. FetchPageTool.frame caps the header to a third of the budget. Red-first test headerLeavesRoomForText.
5 #207 review 4 URLSessionHTTPFetcher(timeout: 8) was hardcoded in both OpenLinkTool and MCPHostController. Shared OpenLinkTool.briefFetchTimeout.
6 #208 review 4 The WebURLPolicy DNS-resolution SSRF gap had no tracking issue. Filed #210.

Carried knowingly (cosmetic, not in this PR): bumpToGeneratingIfStreaming reads messages.last; #205's unconditional outputVolume = 0, the .reinstall comment, isUsable(MicTapFormat), the doubled // in ChatScreen; #203's 60 s window; #206's duplicated rationale; #193's "(TLS)" header drift; BrowserContext.render's lines name.

Verify

  • swift test --filter 'FetchPageToolTests|OpenLinkToolTests|AgentRAGResponderTests|MemoryGroundingTests|FetchPageRoutingTests|OpenLinkRoutingTools|PageBriefTests' → 89 tests / 8 suites green (the new cap test was red first).
  • pytest tools/eval/test_feedback_to_fixtures.py → 5 passed.
  • Mac + iOS app targets build (SettingsScreen + MCPHostController touched).
  • Verify-by-launch owed: the footer copy on the phone's Settings screen.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Bzs575bYuoYBbhH3q9M647

- iOS Grounding footer: "sends your conversation to the internet" — weight
  downloads reach the internet too, so "the only thing" overclaimed (#193 r2).
- feedback_to_fixtures.py closes the JSONL it reads (#207 code-quality bot).
- fallbackPrompt filters the trace ONCE; observations and the page-read flag
  derive from the same survivors (#209 r2, duplicated predicate).
- FetchPageTool.frame caps the title/description header to a third of the
  observation budget so page text always gets a share (#209 r2, red-first).
- OpenLinkTool.briefFetchTimeout shared with the MCP open_link surface (#207 r4).
- WebURLPolicy DNS-resolution SSRF gap filed as #210 (#208 r4).

swift test (7 suites, 89 tests) green; pytest 5/5; Mac + iOS app targets build.

Signed: Kev + claude-fable-5.1, 2026-09-05, Confidence 0.9 — every item read
off the PR thread and re-checked against master before touching it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bzs575bYuoYBbhH3q9M647

# ── MurphySig template (uncomment lines below to sign this commit) ──────
# Significant change detected. If this commit encodes a decision worth
# remembering — architecture, tradeoff, non-obvious fix — sign it.
# Spec: https://murphysig.dev/spec
#
# MurphySig:
#   Signed: Kev + claude-fable-5-1, 2026-09-05
#   Format: MurphySig v0.1
#   Context: <why this exists — the thought, not the diff>
#   Confidence: <0.0-1.0> — <what's uncertain>
#   Open: <unresolved questions>
# ────────────────────────────────────────────────────────────────────────
@netlify

netlify Bot commented Sep 5, 2026

Copy link
Copy Markdown

Deploy Preview for m1k3 canceled.

Name Link
🔨 Latest commit c7f757e
🔍 Latest deploy log https://app.netlify.com/projects/m1k3/deploys/6a9bdc833476cc00082dab4d

@claude

claude Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review

Went through all six items against the diff (c7f757ea). This is a clean, surgical sweep — every change matches what the PR description claims, and each is scoped to exactly the bug it names. No Swift 6 concurrency, actor-isolation, or GRDB/SQL-interpolation concerns here (nothing in this diff touches actors, locks, or SQL string building), and no logic leaked into M1K3App/M1K3iOSApp — the app-target edits are one-line call-site updates to shared package constants/helpers, not new logic.

1. iOS Grounding footer (SettingsScreen.swift) — correct fix, and it's copy-only. Matches the reviewer's exact wording. Comment above the footer is updated to match.

2. feedback_to_fixtures.py context manager — correct, closes the fd. Trivial, no concerns.

3. fallbackPrompt double-filter (AgentRAGResponder.swift) — good de-duplication. I checked the two original predicates character-by-character and they were identical, so unifying into one survivors: [(action, observation)] pass is behavior-preserving, not just DRY — it removes the possibility of the two ever silently diverging on a future edit. observations/pageRead both derive from survivors now.

4. FetchPageTool.frame header cap (FetchPageTool.swift) — this is the meatiest change and it holds up:

  • headerBudget = max / 3 bounds the header independently before the combined string gets its own cap, so a runaway <meta description> can no longer starve text to zero. Walked through the new test's numbers (maxCharacters: 300, header ~1208 chars → capped to 101, + "\n" + text = 123 total, well under 300 so no second truncation fires) — checks out, and the assertions (hasPrefix("Page: T"), contains("THE ACTUAL PAGE TEXT"), count <= 301) are meaningful, not tautological.
  • Both call sites (execute and the readablePage deepen path used by web_search's auto-deepen) were switched to the shared frame helper, so the fix applies uniformly rather than just patching the one path from the original bug report.
  • Confirmed the existing headerIsInsideTheCap / capsOutput tests (short-header cases) still pass under the new two-step cap — header well under max/3 in both, so frame degenerates to the old single-cap behavior. No regression.
  • Minor/non-blocking nit: in the pathological case where both the header and the text are large enough to force the second cap() to fire, the combined string can carry two "…" markers (one from capping the header alone, one from the final cap). Cosmetic, not new — the old code had exactly the same doubled-ellipsis shape whenever a small model got a truncated already-messy page — and correctly out of scope here.

5. OpenLinkTool.briefFetchTimeout (OpenLinkTool.swift, MCPHostController.swift) — clean, removes the drift risk between the in-app open_link tool and the MCP surface. public static let on the tool struct, referenced from the app target's default-parameter position; straightforward.

6. #210 filed for the WebURLPolicy DNS-SSRF gap — no code change needed here, just confirming the tracking issue exists rather than leaving it silently dropped. Good practice.

Provenance — all touched files carry pre-existing Signed:/Review: blocks; new Review: lines are appended additively in the established Kev + claude-fable-5.1, DATE — … format, nothing rewritten or fabricated. No new files, so no Prior: Unknown question arises.

TestsheaderLeavesRoomForText is a real red-first regression test (fails against the pre-fix single-cap code, since a ~1200-char description alone would exceed a 300-char budget and consume 100% of it). No test debt introduced elsewhere; existing suites are unaffected.

Nothing blocking. Nice, tight cleanup PR — the tuple-based survivors refactor in particular is a good example of removing a class of future bug (predicate drift) rather than just papering over the one instance that got caught.

@kpmmmurphy
kpmmmurphy merged commit fd1fae0 into master Sep 5, 2026
20 checks passed
@kpmmmurphy
kpmmmurphy deleted the fix/review-sweep-2026-09-05 branch September 5, 2026 09:29
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