Skip to content

feat(native): record explicit bookmark tab activity - #953

Open
HemSoft wants to merge 1 commit into
mainfrom
feature/native-bookmark-tab-activity
Open

HemSoft wants to merge 1 commit into
mainfrom
feature/native-bookmark-tab-activity

Conversation

@HemSoft

@HemSoft HemSoft commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Risk level: 4/10. Counts must follow explicit opens and never replay after
uncertain acknowledgement or include bookmark content.
Worked on by: gpt-6.1-sol, high effort, on Home.
Owner: chief-dispatch-0c035271-buddy823.

Summary

Closes #952 and advances the independent bookmark workflow under #823.
Electron's bookmark browser views invoke useAppSessionStats on every explicit
open. Native now records one tabsOpened increment before handing that open to
the browser, including reuse or refusal. External opens, missing IDs, refresh,
render and restoration do not record it. The incumbent atomic Convex mutation
receives only the counter; uncertain or failed activity is never replayed.
Existing bookmark visit validation and browser policy are preserved.

Owned source is stats/tab_activity, stats.rs, bookmarks_view mod/service/tests,
the browser-desktop fixture/tests and native bookmarks/dashboard parity docs.
No #951 GitHub/completion or #948 startup/SDK/TLS/pin file is changed. Normal
version/changelog integration stays with the existing owner. Electron remains
primary; Convex and gpui-kit 0.8.1 are unchanged. Session/uptime ownership and
other view counters remain outside this slice.

Validation

  • Original native code fails both new activity assertions; wired code passes
    all 16 bookmarks view tests. Repeated explicit opens count; missing/external
    opens and retained view restoration do not.
  • Both core mutation tests pass, checking the exact content-free payload and
    no replay after rejection, unavailability or uncertain acknowledgement.
  • Formatting and workspace/all-target warnings-denied Clippy pass on Rust1.100.
  • All 566 Python smoke tests pass with eight platform skips. The new browser
    counter gate rejects over/undercounting and unrelated PR/session writes.
  • The installed synthetic browser flow requires three opens, including reuse
    without a new HTTP visit, then no extra writes from restart or tab switching.
    It retains bookmark-activity.json snapshots against its disposable backend.
  • Knip passes. E18e reports 183 documented/transitive warnings and no
    undocumented direct finding. Normal hooks pass all 7640 tests, TypeScript/
    AppHost checks and the coverage ratchet. Version 0.1.1693.

Hosted qualification and Intel Mac failure

SFL Round 1
passed exact head 162955fa403c3b68aa1fdcbec0992658c16d2af5.
Windows Server 2025,
Ubuntu
and Apple silicon
installed qualification passed at this head.

Intel Mac job 133151586290
passed Rust tests, then failed in the initial desktop scene before bookmark
qualification. System Events denied the runner's osascript assistive access
with error -25211 while the driver queried the owned process window count.
The desktop driver and Rust workflow match the base revision byte-for-byte.
This observed runner denial does not justify a bookmark-source change and does
not exempt Intel installed qualification. No runtime permission or profile was
changed. The successful platform runs remain preserved.

A narrow Intel retry remains owned here after the workflow is terminal, the
head is rechecked and actual macOS queue-drain evidence permits it. No retry,
new matrix push, merge or delivery is claimed. Performance and final guarded
review/check/evidence gates remain incomplete.

Rendered acceptance evidence at 162955f

The successful hosted Apple silicon artifact14230567277 matches this exact
head and passed SHA-256 verification against GitHub's recorded digest.
Its isolated Convex bookmark-activity.json records:

Stage tabsOpened
Before explicit opens 0
After three opens, including repeated URL 3
After restart 3
After tab switching and restoration 3

All other tracked activity and session fields remain unchanged. This is synthetic
hosted acceptance, with no production account or profile involved.

Large dark bookmark browser on hosted Apple silicon

Compact light bookmark browser on hosted Apple silicon

Restored dark browser tab on hosted Apple silicon

Dark interaction, 25 seconds:

dark-interaction.mp4

Light interaction, 8.25 seconds:

light-interaction.mp4

No Home GUI, production-account/profile, installer replay, physical speaker,
installed Windows11 or personal Mac acceptance is claimed. Intel qualification,
applicable performance/CI results and final guarded revalidation remain gates.
The existing hosted installer runs the browser scene with
BUDDY_SETTINGS_FIXTURE=1 python3 scripts/native-smoke/browser-desktop.py --executable <installed-buddy-native> --output <owned-browser-evidence> --session macos --version 0.1.1693.
This command is for the existing isolated hosted runner, not a personal profile.

@HemSoft HemSoft added enhancement New feature or request risk:medium Medium-risk: logic changes, new features model:gpt-6.1-sol PR authored by gpt-6.1-sol labels Nov 16, 2026
@HemSoft

HemSoft commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

@sfl review

@hemsoft-sfl-reviewer hemsoft-sfl-reviewer Bot 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.

✅ Verdict: PASS • Round 1

Confidence: 8/10 · Project risk: 4/10 (hs-buddy)

Review done by claude-opus-5-5 (adversarial to codex)

Native Bookmarks now sends one fire-and-forget tabsOpened increment through buddyStats:batchIncrement for each explicit embedded open, and the change adds unit tests, a smoke-flow counter gate and docs. The diff matches Electron's openTab → trackViewOpen behavior, reuses the incumbent PR-list activity pattern, and no evidenced Critical, High or Medium defect was found.

🔨 Full-Spectrum Review Summary

Effort: high
Review time: 1m 39s
Token count: Unavailable

Pass 🔴 Critical 🟠 High 🟡 Medium ⚪ Low
🔒 Security 0 0 0 0
✅ Accuracy 0 0 0 0
🧰 Quality & Maintainability 0 0 0 0
Total 0 0 0 0

Key Findings

No material defects found.

Coverage

  • Files reviewed:
    • CHANGELOG.md
    • docs/GPUI-DASHBOARD-PARITY.md
    • docs/NATIVE-BOOKMARKS.md
    • package.json
    • rust/crates/buddy-app/src/bookmarks_view/mod.rs
    • rust/crates/buddy-app/src/bookmarks_view/service.rs
    • rust/crates/buddy-app/src/bookmarks_view/tests.rs
    • rust/crates/buddy-core/src/stats.rs
    • rust/crates/buddy-core/src/stats/tab_activity.rs
    • scripts/native-smoke/browser-desktop.py
    • scripts/native-smoke/test_browser_desktop.py
  • Context read:
    • rust/crates/buddy-core/src/stats/pr_list_activity.rs
    • src/hooks/useAppSessionStats.ts
    • src/hooks/useAppTabs.ts
    • src/App.tsx
    • src/components/bookmarks/BookmarkList.tsx
    • convex/buddyStats.ts
  • Verified:
    • Compare base_commit.sha is 458c5638 and the last commit is 162955fa; the PR is 1 ahead and 0 behind
    • gh api user returned HemSoft under the per-process GH_CONFIG_DIR profile
    • Electron openTab calls onViewOpen before its existing-tab and browser-URL reuse checks, so repeated and refused opens count; handleOpenExternal never counts. Native open records before OpenInTab and open_externally does not record, which matches
    • Native open returns early for a missing ID before recording, and the new test covers missing, external, active toggling and destination.restore
    • The payload {fields:{tabsOpened:1}} names a member of COUNTER_FIELDS in batchIncrement, the same mutation and backend.call(..., true) path used by pr_list_activity
    • buddyStats:get returns zero defaults when no document exists, so the smoke gate's .get deltas are safe on a fresh backend
    • The smoke first_pass makes three bookmark content opens (Probe, Fixture, Fixture repeat), matching require_bookmark_activity(..., 3)
    • The existing open test makes three open calls, matching the new tab_opens == 3 assertion; AtomicUsize and Ordering are already imported and Fake derives Default
    • Runtime::spawn_detached exists in buddy-app/src/runtime.rs and is used by other views
    • Only the counter is sent; no URL, title or bookmark ID reaches the stats payload
  • Not verified:
    • Compilation, Clippy and test results claimed in the PR body; execution is forbidden
    • The installed smoke flow on hosted runners; current-head qualification is still pending per the PR body
    • Whether the third fire-and-forget write always lands before drive ends the app session; the code was read, not run
    • The BrowserDriver step semantics (content, workspace) that the smoke script relies on; that module was not read
  • Tests run: None. Reviewer execution is disabled.

HemSoft full-spectrum review • 3 evidence-based passes • Reviewed head 162955fa403c3b68aa1fdcbec0992658c16d2af5 • SFL v0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request model:gpt-6.1-sol PR authored by gpt-6.1-sol risk:medium Medium-risk: logic changes, new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record native bookmark tab-open activity

1 participant