[Task] Harden remote module catalog trust state and replay validation #209

Closed
opened 2026-07-07 15:03:22 +02:00 by zemion · 2 comments
Owner

Objective

Finish production hardening for remote module catalog consumption in core.

Scope

  • Persist accepted channel sequence state across installs.
  • Add regression coverage for URL cache fallback, expired catalogs, not-before catalogs, and strict replay mode.
  • Document operator recovery if a sequence state file is lost or corrupted.
  • Ensure admin and CLI validation report source, channel, sequence, freshness, signature, and key id consistently.

Acceptance Criteria

  • URL-backed catalogs work with cache fallback and signed validation.
  • Sequence replay protection rejects older and already-accepted catalogs when configured.
  • Operator docs explain reset/recovery procedure.
  • Tests cover local file, remote URL, cache fallback, expiry, and replay.

Verification Target

python -m unittest tests.test_module_system

Codex-Fingerprint: catalog-trust-replay-production-hardening

## Objective Finish production hardening for remote module catalog consumption in core. ## Scope - Persist accepted channel sequence state across installs. - Add regression coverage for URL cache fallback, expired catalogs, not-before catalogs, and strict replay mode. - Document operator recovery if a sequence state file is lost or corrupted. - Ensure admin and CLI validation report source, channel, sequence, freshness, signature, and key id consistently. ## Acceptance Criteria - [ ] URL-backed catalogs work with cache fallback and signed validation. - [ ] Sequence replay protection rejects older and already-accepted catalogs when configured. - [ ] Operator docs explain reset/recovery procedure. - [ ] Tests cover local file, remote URL, cache fallback, expiry, and replay. ## Verification Target `python -m unittest tests.test_module_system` Codex-Fingerprint: catalog-trust-replay-production-hardening
Author
Owner

Codex State: progress

Summary

  • Added release catalog key generation, signed catalog generation, and govoplan-web publication wrappers.
  • Generated and validated local stable catalog for v0.1.4 with release-key-1.

Changed Files

  • scripts/generate-catalog-keypair.py
  • scripts/generate-release-catalog.py
  • scripts/publish-release-catalog.sh
  • scripts/push-release-tag.sh
  • docs/RELEASE_CATALOG_WORKFLOW.md

Verification

  • bash -n scripts/publish-release-catalog.sh scripts/push-release-tag.sh
  • ./.venv/bin/python -m py_compile scripts/generate-catalog-keypair.py scripts/generate-release-catalog.py
  • GOVOPLAN_MODULE_PACKAGE_CATALOG_TRUSTED_KEYS_FILE=/mnt/DATA/git/govoplan-web/public/catalogs/v1/keyring.json ./.venv/bin/python -m govoplan_core.commands.module_installer --validate-package-catalog /mnt/DATA/git/govoplan-web/public/catalogs/v1/channels/stable.json --require-signed-catalog --approved-catalog-channel stable --format json

Next / Blocked

  • Artifact digest/SBOM verification remains tracked separately.

Suggested status label: status/in-progress

## Codex State: progress ### Summary - Added release catalog key generation, signed catalog generation, and govoplan-web publication wrappers. - Generated and validated local stable catalog for v0.1.4 with release-key-1. ### Changed Files - `scripts/generate-catalog-keypair.py` - `scripts/generate-release-catalog.py` - `scripts/publish-release-catalog.sh` - `scripts/push-release-tag.sh` - `docs/RELEASE_CATALOG_WORKFLOW.md` ### Verification - `bash -n scripts/publish-release-catalog.sh scripts/push-release-tag.sh` - `./.venv/bin/python -m py_compile scripts/generate-catalog-keypair.py scripts/generate-release-catalog.py` - `GOVOPLAN_MODULE_PACKAGE_CATALOG_TRUSTED_KEYS_FILE=/mnt/DATA/git/govoplan-web/public/catalogs/v1/keyring.json ./.venv/bin/python -m govoplan_core.commands.module_installer --validate-package-catalog /mnt/DATA/git/govoplan-web/public/catalogs/v1/channels/stable.json --require-signed-catalog --approved-catalog-channel stable --format json` ### Next / Blocked - Artifact digest/SBOM verification remains tracked separately. Suggested status label: `status/in-progress`
Author
Owner

Codex State: done

Summary

  • Hardened remote module catalog validation. URL-backed catalogs now report cache fallback metadata while still validating the cached body with signature, approved channel, freshness, and replay checks. Validation results now consistently include source/source_type/cache_used/cache_path, channel, sequence, generated_at/not_before/expires_at, signed/trusted state, and key id for CLI JSON and admin API consumers. Admin module catalog responses and the WebUI catalog panel expose cache fallback and not-before metadata. Operator docs now describe sequence-state backup, corruption/loss recovery, and safe reset rules.

Changed Files

  • Core: src/govoplan_core/core/module_package_catalog.py, tests/test_module_system.py, docs/CATALOG_TRUST_AND_LICENSING.md, docs/RELEASE_DEPENDENCIES.md. Admin: /mnt/DATA/git/govoplan-admin/src/govoplan_admin/backend/api/v1/routes.py, schemas.py, webui/src/api/admin.ts, webui/src/features/admin/ModuleManagementPanel.tsx.

Verification

  • ./.venv/bin/python -m py_compile src/govoplan_core/core/module_package_catalog.py /mnt/DATA/git/govoplan-admin/src/govoplan_admin/backend/api/v1/routes.py /mnt/DATA/git/govoplan-admin/src/govoplan_admin/backend/api/v1/schemas.py
  • ./.venv/bin/python -m unittest tests.test_module_system.ModuleSystemTests.test_module_package_catalog_loads_json_entries tests.test_module_system.ModuleSystemTests.test_module_package_catalog_validation_reports_bad_entries tests.test_module_system.ModuleSystemTests.test_module_package_catalog_validates_signed_approved_channel tests.test_module_system.ModuleSystemTests.test_module_package_catalog_validates_remote_url_and_cache_fallback tests.test_module_system.ModuleSystemTests.test_module_package_catalog_rejects_unapproved_channel_when_required tests.test_module_system.ModuleSystemTests.test_module_package_catalog_rejects_expired_catalog tests.test_module_system.ModuleSystemTests.test_module_package_catalog_rejects_not_before_catalog tests.test_module_system.ModuleSystemTests.test_module_package_catalog_records_sequence_acceptance tests.test_module_system.ModuleSystemTests.test_module_installer_validates_package_catalog_from_cli
  • PATH=/mnt/DATA/git/govoplan-core/webui/node_modules/.bin:/home/zemion/.nvm/versions/node/v22.22.3/bin:/home/zemion/.local/bin:/home/zemion/.codex/tmp/arg0/codex-arg0EWzbZZ:/app/bin:/app/bin:/app/bin:/usr/bin:/usr/lib/sdk/openjdk25/bin:/home/zemion/.var/app/com.vscodium.codium/data/node/bin:/home/zemion/.var/app/com.vscodium.codium/data/cargo/bin:/home/zemion/.var/app/com.vscodium.codium/data/python/bin:/home/zemion/.var/app/com.vscodium.codium/data/codium/extensions/openai.chatgpt-26.5623.101652-linux-x64/bin/linux-x86_64 /home/zemion/.nvm/versions/node/v22.22.3/bin/npm run build (from webui; passed, with existing npm tmp warning)
  • ./.venv/bin/python scripts/check_dependency_boundaries.py
  • git diff --check for changed core/admin files
  • ./.venv/bin/python -m unittest tests.test_module_system (55 tests passed; existing SQLite ResourceWarnings only)
## Codex State: done ### Summary - Hardened remote module catalog validation. URL-backed catalogs now report cache fallback metadata while still validating the cached body with signature, approved channel, freshness, and replay checks. Validation results now consistently include source/source_type/cache_used/cache_path, channel, sequence, generated_at/not_before/expires_at, signed/trusted state, and key id for CLI JSON and admin API consumers. Admin module catalog responses and the WebUI catalog panel expose cache fallback and not-before metadata. Operator docs now describe sequence-state backup, corruption/loss recovery, and safe reset rules. ### Changed Files - `Core: src/govoplan_core/core/module_package_catalog.py, tests/test_module_system.py, docs/CATALOG_TRUST_AND_LICENSING.md, docs/RELEASE_DEPENDENCIES.md. Admin: /mnt/DATA/git/govoplan-admin/src/govoplan_admin/backend/api/v1/routes.py, schemas.py, webui/src/api/admin.ts, webui/src/features/admin/ModuleManagementPanel.tsx.` ### Verification - `./.venv/bin/python -m py_compile src/govoplan_core/core/module_package_catalog.py /mnt/DATA/git/govoplan-admin/src/govoplan_admin/backend/api/v1/routes.py /mnt/DATA/git/govoplan-admin/src/govoplan_admin/backend/api/v1/schemas.py` - `./.venv/bin/python -m unittest tests.test_module_system.ModuleSystemTests.test_module_package_catalog_loads_json_entries tests.test_module_system.ModuleSystemTests.test_module_package_catalog_validation_reports_bad_entries tests.test_module_system.ModuleSystemTests.test_module_package_catalog_validates_signed_approved_channel tests.test_module_system.ModuleSystemTests.test_module_package_catalog_validates_remote_url_and_cache_fallback tests.test_module_system.ModuleSystemTests.test_module_package_catalog_rejects_unapproved_channel_when_required tests.test_module_system.ModuleSystemTests.test_module_package_catalog_rejects_expired_catalog tests.test_module_system.ModuleSystemTests.test_module_package_catalog_rejects_not_before_catalog tests.test_module_system.ModuleSystemTests.test_module_package_catalog_records_sequence_acceptance tests.test_module_system.ModuleSystemTests.test_module_installer_validates_package_catalog_from_cli` - `PATH=/mnt/DATA/git/govoplan-core/webui/node_modules/.bin:/home/zemion/.nvm/versions/node/v22.22.3/bin:/home/zemion/.local/bin:/home/zemion/.codex/tmp/arg0/codex-arg0EWzbZZ:/app/bin:/app/bin:/app/bin:/usr/bin:/usr/lib/sdk/openjdk25/bin:/home/zemion/.var/app/com.vscodium.codium/data/node/bin:/home/zemion/.var/app/com.vscodium.codium/data/cargo/bin:/home/zemion/.var/app/com.vscodium.codium/data/python/bin:/home/zemion/.var/app/com.vscodium.codium/data/codium/extensions/openai.chatgpt-26.5623.101652-linux-x64/bin/linux-x86_64 /home/zemion/.nvm/versions/node/v22.22.3/bin/npm run build (from webui; passed, with existing npm tmp warning)` - `./.venv/bin/python scripts/check_dependency_boundaries.py` - `git diff --check for changed core/admin files` - `./.venv/bin/python -m unittest tests.test_module_system (55 tests passed; existing SQLite ResourceWarnings only)`
zemion added the
type
task
status
ready
area/module-system
labels 2026-07-07 23:08:07 +02:00
zemion added the
module/core
label 2026-07-07 23:42:14 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: add-ideas/govoplan-core#209
No description provided.