Skip to content

Flag sources that changed since ingest; Flatpak dev loop and PDF support - #42

Merged
francescobianco merged 5 commits into
mainfrom
feat/stale-sources
Oct 19, 2026
Merged

francescobianco merged 5 commits into
mainfrom
feat/stale-sources

Conversation

@francescobianco

Copy link
Copy Markdown
Member

Prompted by a comment on the dev.to launch article from a Fedora user building a GNOME app. Three points, three changes.

Drift, not hallucination

in my experience docs went stale because the source changed, not because the model hallucinated

Every source already stores the SHA-256 it was ingested from, and every page stores the source ids behind it, so drift is a hash comparison:

  • core/lint.py: ChangeDetector.stale_sources() returns ingested sources whose original file no longer matches, each with the pages that cite it. Hashes are memoised by (path, size, mtime). A deleted original is not drift.
  • IngestionManager.refresh_source(): copies the new version into sources/, updates hash and size, then re-ingests through reingest_source from fix: support source re-ingestion and removal #30.
  • UI: changed sources show "changed since ingest" with a warning icon, and the Re-ingest button turns into Update. A toast appears when the project opens and when the window regains focus (files are usually edited in another app).
  • MCP: a new stale_sources tool, the lint step of Karpathy's pattern.

The rest of lint (orphans, broken links, duplicate titles: #2, #14) can live in the same module.

Develop against the runtime users get

make start-flatpak runs the make start loop inside org.gnome.Platform (version read from the manifest). Tested on GNOME 51: the app runs, and the differences from the host libadwaita show (accent colour, for example). Documented in CONTRIBUTING.

Flatpak

  • The Flatpak build has been green since the GNOME 51 bump, and the Pages remote installs end to end (flatpak install --user https://openapi.github.io/gknowledge/io.gknowledge.Gknowledge.flatpakref → 0.2.2 launches). Closes Fix the Flatpak build (appstreamcli compose fails) #24.
  • The 0.2.2 bundle fails on import pypdf, so PDFs could not be imported. pypdf 6.19.0 is now vendored from its wheel. Check the flatpak CI job on this PR: it is still continue-on-error.
  • README: no more "Flatpak planned".

Tests

make test and pytest tests: 17 passed, including new tests for drift detection, refresh and the MCP tool. The UI was checked by hand with a modified source, on the host GTK and on the GNOME 51 runtime.

🤖 Generated with Claude Code

francescobianco and others added 5 commits October 19, 2026 12:27
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…F support

Generated pages rarely go wrong because the model invents something; they
go wrong because the source moved on. Every source already stores the hash
it was ingested from, so drift is a hash comparison:

- core/lint.py: ChangeDetector reports ingested sources whose original file
  no longer matches, with the pages that cite them (hashes memoised by
  size and mtime).
- IngestionManager.refresh_source(): take the new version, update hash and
  size, re-ingest (builds on reingest_source from #30).
- UI: changed sources are marked "changed since ingest"; Re-ingest becomes
  "Update"; a toast on open and when the window regains focus.
- MCP: stale_sources tool, the lint step of Karpathy's pattern.

Flatpak:
- make start-flatpak runs the dev loop inside org.gnome.Platform, whose
  GTK/libadwaita differ from the host's; documented in CONTRIBUTING.
- Vendor pypdf 6.19.0: the 0.2.2 bundle cannot import PDFs.
- README no longer says "Flatpak planned": the Pages remote installs.

Suggested by a reader on dev.to (FromTheArchitect, comment 3i4d5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@francescobianco
francescobianco merged commit 3262602 into main Oct 19, 2026
4 checks passed
@francescobianco
francescobianco deleted the feat/stale-sources branch October 19, 2026 10:47
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.

Fix the Flatpak build (appstreamcli compose fails)

1 participant