Skip to content

feat(files): pin a file's doc so it is always regenerated (#812) - #2110

Open
sloemo01 wants to merge 2 commits into
repowise-dev:mainfrom
sloemo01:feat/file-doc-pin
Open

feat(files): pin a file's doc so it is always regenerated (#812)#2110
sloemo01 wants to merge 2 commits into
repowise-dev:mainfrom
sloemo01:feat/file-doc-pin

Conversation

@sloemo01

@sloemo01 sloemo01 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What

Fixes #812 — the pin half of "generate a doc for an undocumented file and keep it synced".

Root cause

The Doc tab's empty state had no way to get a page for one file, and any page that did exist could silently disappear on the next reindex when the selection heuristic skipped it.

Changes

  • Page.pinned column (additive; picked up by the existing schema reconciler)
  • PageRecord.pinned + resolve_page_selection always includes pinned pages, so every generation run regenerates them regardless of the selection heuristic — the keep-it-synced guarantee
  • load_page_records carries pinned through from persisted rows
  • POST /{repo_id}/files/{path}/pin-doc: pins an existing page, or creates a lightweight template row (reads as unwritten) for a file with no page yet
  • FileWikiPageRef.pinned in the file-detail aggregate (types + server)
  • api-client pinFileDoc()
  • UI: "Generate doc" button on the empty Doc tab via an onGenerateDoc prop

Tests

  • resolve_page_selection includes pinned pages under empty intent; endpoint creates+pins, pins in place (content untouched), 404s on unknown repo. 2219 generation/server/persistence tests pass.

Note: test_plugin_content is red on main itself (v0.47.0 release bug, unrelated to this PR).

@repowise-bot

repowise-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

🔍 2 things to check

  1. FileDocTab in .../files/file-doc-tab.tsx signature changed. Review 1 caller outside this PR: .../files/file-page-panels.tsx::buildFilePanels
  2. Run .../src/hosted.fixtures.test.ts, .../analysis/test_impact.py, .../analysis/test_reachability.py (+13 more) first: they import the changed files

✅ Health of changed files: 5.2 → 5.3 (+0.1)
⚠️ Change risk: moderate, riskier than 43% of this repo's commits.

👀 Suggested reviewers @RaghavChamadiya


📊 See the full report for this PR
Your repo map with this PR's blast radius lit up, every caller of the contracts it changes, and health before and after. No sign-in. · ⭐ Star Repowise · 📥 Install bot · Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings?tab=bot · Updated 2026-09-03 22:19 UTC

…ev#812)

The Doc tab's empty state needs a way to get a page for one file, and that
page needs to stay in step with the code rather than silently disappearing
on the next reindex. This is the pin half of issue repowise-dev#812:

- Page.pinned column (auto-migrated by the schema reconciler)
- PageRecord.pinned + resolve_page_selection always includes pinned pages,
  so every generation run regenerates them regardless of the heuristic
- load_page_records carries pinned through from persisted rows
- POST /{repo_id}/files/{path}/pin-doc: pins an existing page, or creates
  a lightweight template row (reads as unwritten) for a file with no page
- FileWikiPageRef.pinned in the file-detail aggregate (types + server)
- api-client pinFileDoc()
- UI: 'Generate doc' button on the empty Doc tab via onGenerateDoc prop

Tests: selection pins pinned pages; endpoint creates+pins, pins in place,
404s on unknown repo. 2219 generation/server/persistence tests pass.
…act (repowise-dev#812)

CI caught test_response_contract: the new pin-doc route served an
anonymous JSON body. Modeled PinDocResponse (file_path, pinned) and
typed the route against it, so the OpenAPI generator ships a schema
instead of adding an entry to WAIVED/UNMODELLED debt.

8 response-contract + file-pin tests pass.
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.

Generate a doc from the UI for an undocumented file, and keep it synced

1 participant