Skip to content

Implement cold-store archive with read-only mode for visitors - #16

Merged
NotReeceHarris merged 1 commit into
mainfrom
feature/15/offline-storage-system
Jul 21, 2026
Merged

NotReeceHarris merged 1 commit into
mainfrom
feature/15/offline-storage-system

Conversation

@NotReeceHarris

Copy link
Copy Markdown
Owner

This pull request introduces a cold-store archive and anonymous read-only mode for the forum by adding a new data sync workflow and updating the configuration, documentation, and client code accordingly. The core reputation workflow and its supporting files are removed, with all data and enforcement now managed by the new data-sync.yml workflow and associated scripts. Documentation is updated to reflect these changes, and the codebase now supports serving forum content to signed-out users via a public data branch.

Major feature additions and changes:

Archive and Anonymous Read-Only Mode

  • Added a cold-store archive system, enabling a read-only mode for signed-out users by snapshotting all discussions and rep data to a public data branch, which is then served directly from GitHub's CDN. This is configured in forum.config.ts and described in the README. [1] [2] [3]
  • Introduced the src/lib/archive/client.ts module, which provides fetchers for archived forum data, discussions, and per-user reputation from the data branch.

Workflow and Infrastructure Updates

  • Added .github/workflows/data-sync.yml to maintain the data branch, snapshotting all forum data and rep profiles on every relevant event and on a schedule. The workflow force-pushes a single-commit snapshot, ensuring the branch stays up-to-date and self-healing.
  • Removed the old reputation workflow (.github/workflows/rep.yml) and its entrypoint script (.github/scripts/rep-action.ts), consolidating all data and enforcement into the new data sync workflow. [1] [2]

Documentation and Configuration

  • Updated the README to explain the new archive and data branch system, including usage instructions, caveats, and the new file layout. The reputation system documentation is updated to reflect that rep data now lives on the data branch. [1] [2] [3]
  • Extended the forum configuration (forum.config.ts) with an archive section to enable the archive feature.

UI Integration

  • Updated UI logic to import and use the new archiveMode flag, allowing the app to conditionally handle anonymous read-only mode.

Most important changes:

Archive and Data Branch

  • Added cold-store archive support and anonymous read-only browsing by snapshotting discussions and rep data to a public data branch, with configuration and documentation updates. [1] [2] [3]
  • Introduced the src/lib/archive/client.ts module for fetching archived forum data and user reputation from the CDN-backed data branch.

Workflow and Data Sync

  • Added .github/workflows/data-sync.yml to maintain the data branch, replacing the previous reputation workflow and providing a unified, self-healing data sync mechanism.
  • Removed the old reputation workflow and its script, consolidating all rep and enforcement logic into the new data sync process. [1] [2]

Documentation and UI

  • Updated the README and configuration to document and enable the archive feature, and updated the UI to support archive mode. [1] [2] [3] [4] [5]

… visitors

- Add a new GitHub Actions workflow for data synchronization to maintain a snapshot of forum discussions.
- Remove the old reputation workflow as its functionality is now integrated into the new data sync workflow.
- Update README and configuration files to reflect the new archive feature and its settings.
- Create a client for fetching archived data, including discussions and user reputation profiles.
- Modify UI components to support read-only mode, displaying archived content for signed-out users.
- Implement tests for the new archive functionality, ensuring proper fetching and handling of archived data.
@NotReeceHarris NotReeceHarris self-assigned this Jul 21, 2026
@NotReeceHarris NotReeceHarris added the enhancement New feature or request label Jul 21, 2026
@github-actions

Copy link
Copy Markdown

🧪 Test coverage

File                           Stmts %  Branch %  Funcs %  Lines %
-----------------------------  -------  --------  -------  -------
oauth-proxy/worker.js              100       100      100      100
src/lib/archive/client.ts          100       100      100      100
src/lib/cache.ts                   100       100      100      100
src/lib/config/index.ts            100       100      100      100
src/lib/config/schema.ts           100       100      100      100
src/lib/github/api.ts              100       100      100      100
src/lib/github/auth.svelte.ts      100       100      100      100
src/lib/rep/engine.ts              100       100      100      100
src/lib/rep/ledger.ts              100       100      100      100
src/lib/ui.svelte.ts               100       100      100      100
src/lib/utils.ts                   100       100      100      100
TOTAL                              100       100      100      100

@NotReeceHarris
NotReeceHarris merged commit 490a8d1 into main Jul 21, 2026
4 of 5 checks passed
@NotReeceHarris
NotReeceHarris deleted the feature/15/offline-storage-system branch July 21, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: data branch cold-store archive + per-profile rep — anonymous read-only mode

1 participant