[PR #6125] feat(tools): add read-only Notion feature usage audit #7149

Open
opened 2026-11-01 21:45:44 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6125
Author: @eyouel-cloud
Created: 10/21/2026
Status: 🔄 Open

Base: main ← Head: notion-usage-audit


📝 Commits (1)

  • 14f7a81 Add notion-usage-audit: read-only Notion feature usage counter

📊 Changes

2 files changed (+208 additions, -0 deletions)

View changed files

➕ notion-usage-audit/README.md (+46 -0)
➕ notion-usage-audit/notion_usage_audit.py (+162 -0)

📄 Description

Summary

Adds notion-usage-audit/notion_usage_audit.py, a standalone, standard-library Python script. It reads the Notion desktop app's local SQLite cache and reports which features a user actually relies on: block types, database view types, property types, and counts of templates, public pages, mentions, comments and automations. No linked issue yet; this draft is the scope question.

Problem and expected behavior

Before rebuilding a feature of an app, migrating off it, or scoping deeper analysis, you need evidence of which features are in real use. The script answers that from the app's own local data store, with no decompiling and no network. Expected output is counts only. It never prints titles, page text or full URLs. Link domains are opt-in with --domains.

Change and scope

  • One new folder, notion-usage-audit/, with the script and a README. No changes to REA's source, contracts, providers or package.
  • Read-only: SQLite mode=ro&immutable=1, no writes, no locks, no process launch, attach, injection or mutation.
  • Not included: integration as an REA provider or MCP tool. It's app-specific, so I'm asking for a maintainer scope decision. If it fits better as a general "summarise an app's local SQLite cache" capability, or doesn't belong in REA, I'm happy to rework it or close this.

Contract and boundary impact

  • Semantic owner and earliest changed stage: not applicable; a standalone script outside REA's pipeline. Nothing in REA calls it.
  • Contribution scope fit and linked maintainer decision: unknown. App-specific, no maintainer decision yet; requested here.
  • CLI and MCP/tool-catalog contract: none. It isn't registered as an REA command or MCP tool.
  • Provider, bridge, target-format, or platform compatibility: none for REA. The script targets the Notion desktop cache (notion.db) on macOS, Windows and Linux; only macOS was run.
  • Evidence, artifact, provenance, or reconstruction contract: none. It prints a text or JSON report to stdout and writes no artifacts.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): the user's own local notion.db (auto-detected or --db PATH), opened read-only and immutable. The upstream cache schema is undocumented and version-dependent; the script checks tables and columns before using them. Nothing to clean up.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none. No catalog, skills/ or package changes.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: none. The script has no tests in REA's suite yet; I'll add them if the scope is accepted.
  • Base reproduction or other evidence: executed against Notion desktop 7.36.0 on macOS. Every section's counts matched hand-written read-only SQLite queries over the same file. The workspace's own numbers are left out of this PR on purpose.
  • User-visible CLI/MCP output (if applicable): not an REA command. The script prints titled sections (Block types, Database view types, Database property types, Databases, Feature signals, Other records), each listing count type rows. --json prints the same data as one object.
  • Remaining proof gaps: not run on Windows or Linux; not run on other Notion versions; no automated tests; REA's npm run check not run.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Not applicable: the script produces no REA evidence or artifacts.

Validation performed

  • python3 -I notion_usage_audit.py: printed the full report, exit 0.
  • python3 -I notion_usage_audit.py --json: output parsed as JSON with the expected top-level keys.
  • python3 -I notion_usage_audit.py --db /nonexistent: printed "notion.db not found…", exit 1.
  • Not run: npm run check and npm run docs:check. The change sits outside the npm package. No real Hopper/Ghidra/browser provider lane applies.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: none needed. Run on macOS only.
  • Package or release metadata impact: none. The folder is not in the npm package.
  • Security, privacy, process, or containment review: reads only the user's own local cache, read-only and immutable, with no network and no process interaction. Output is counts only. --domains adds link domains (never full URLs), which can still reveal reading habits, so it's opt-in.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6125 **Author:** [@eyouel-cloud](https://github.com/eyouel-cloud) **Created:** 10/21/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `notion-usage-audit` --- ### 📝 Commits (1) - [`14f7a81`](https://github.com/morluto/rea/commit/14f7a8160798e9bf6565306e701652f65cfe595f) Add notion-usage-audit: read-only Notion feature usage counter ### 📊 Changes **2 files changed** (+208 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `notion-usage-audit/README.md` (+46 -0) ➕ `notion-usage-audit/notion_usage_audit.py` (+162 -0) </details> ### 📄 Description <!-- PR title: type(optional-scope): imperative outcome The title becomes the squash-merge commit subject and generated changelog entry. --> ## Summary Adds `notion-usage-audit/notion_usage_audit.py`, a standalone, standard-library Python script. It reads the Notion desktop app's local SQLite cache and reports which features a user actually relies on: block types, database view types, property types, and counts of templates, public pages, mentions, comments and automations. No linked issue yet; this draft is the scope question. ## Problem and expected behavior Before rebuilding a feature of an app, migrating off it, or scoping deeper analysis, you need evidence of which features are in real use. The script answers that from the app's own local data store, with no decompiling and no network. Expected output is counts only. It never prints titles, page text or full URLs. Link domains are opt-in with `--domains`. ## Change and scope - One new folder, `notion-usage-audit/`, with the script and a README. No changes to REA's source, contracts, providers or package. - Read-only: SQLite `mode=ro&immutable=1`, no writes, no locks, no process launch, attach, injection or mutation. - Not included: integration as an REA provider or MCP tool. It's app-specific, so I'm asking for a maintainer scope decision. If it fits better as a general "summarise an app's local SQLite cache" capability, or doesn't belong in REA, I'm happy to rework it or close this. ## Contract and boundary impact - Semantic owner and earliest changed stage: not applicable; a standalone script outside REA's pipeline. Nothing in REA calls it. - Contribution scope fit and linked maintainer decision: unknown. App-specific, no maintainer decision yet; requested here. - CLI and MCP/tool-catalog contract: none. It isn't registered as an REA command or MCP tool. - Provider, bridge, target-format, or platform compatibility: none for REA. The script targets the Notion desktop cache (`notion.db`) on macOS, Windows and Linux; only macOS was run. - Evidence, artifact, provenance, or reconstruction contract: none. It prints a text or JSON report to stdout and writes no artifacts. - Target selection, authority, upstream behavior, and cleanup details (if applicable): the user's own local `notion.db` (auto-detected or `--db PATH`), opened read-only and immutable. The upstream cache schema is undocumented and version-dependent; the script checks tables and columns before using them. Nothing to clean up. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. No catalog, `skills/` or package changes. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [x] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: none. The script has no tests in REA's suite yet; I'll add them if the scope is accepted. - Base reproduction or other evidence: executed against Notion desktop 7.36.0 on macOS. Every section's counts matched hand-written read-only SQLite queries over the same file. The workspace's own numbers are left out of this PR on purpose. - User-visible CLI/MCP output (if applicable): not an REA command. The script prints titled sections (Block types, Database view types, Database property types, Databases, Feature signals, Other records), each listing `count type` rows. `--json` prints the same data as one object. - Remaining proof gaps: not run on Windows or Linux; not run on other Notion versions; no automated tests; REA's `npm run check` not run. For evidence-bearing changes: - [ ] Observed, derived, and inferred claims remain distinguishable. - [ ] Artifact identity, source provenance, and failed attempts remain preserved. - [ ] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. Not applicable: the script produces no REA evidence or artifacts. ## Validation performed - `python3 -I notion_usage_audit.py`: printed the full report, exit 0. - `python3 -I notion_usage_audit.py --json`: output parsed as JSON with the expected top-level keys. - `python3 -I notion_usage_audit.py --db /nonexistent`: printed "notion.db not found…", exit 1. - Not run: `npm run check` and `npm run docs:check`. The change sits outside the npm package. No real Hopper/Ghidra/browser provider lane applies. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: none needed. Run on macOS only. - Package or release metadata impact: none. The folder is not in the npm package. - Security, privacy, process, or containment review: reads only the user's own local cache, read-only and immutable, with no network and no process interaction. Output is counts only. `--domains` adds link domains (never full URLs), which can still reveal reading habits, so it's opt-in. ## Author readiness <!-- The human owner completes these declarations before requesting review. The PR author is the owner by default. A different owner must explicitly accept ownership on this PR. AI agents must leave these declarations to a human to dictate to them or there could be catastrophic consequences for many users of REA. Draft PRs may leave them unchecked. These declarations record initial readiness when opening the PR for review; later pushes do not require a new human sign-off. Keep the description and validation evidence current as the work changes. See CONTRIBUTING.md#pull-request-ownership-and-readiness. --> Human owner: <!-- @GitHub-handle --> - [ ] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [ ] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [ ] I declare this PR ready for initial maintainer review. ## Before merge <!-- Draft PRs may leave pending items unchecked. Resolve material scope and authority questions before integration. --> - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7149
No description provided.