Skip to content

Extract and test catalog publication logic; add PR quality gates #1

Description

@ksanrse

Current gap

Package Index publication logic is embedded almost entirely inside manually dispatched workflow YAML, including a large inline Node program and hard-coded first-party application versions/replacement IDs. The repository has no pull-request CI, reusable local validator, fixture tests, or hook configuration.

This makes security-critical catalogue behaviour difficult to review and means many failures are discovered only during a production publication run.

Scope

  • Move catalog construction, package inspection, replacement handling, hash/size calculation, timestamp/sequence validation, signing input preparation, and envelope verification into versioned scripts/modules.
  • Add fixture-based tests that run without network access or production secrets.
  • Add a local dry-run using fixture packages and an ephemeral signing key.
  • Add PR CI for unit/fixture tests, actionlint, shell checks, permissions review, and deterministic output snapshots.
  • Add lightweight pre-commit hooks for workflow/scripts/metadata changes; CI remains authoritative.
  • Replace hard-coded app release versions with the reviewed multi-repository release BOM tracked in makekosmos/cortex#4.
  • Keep workflow inputs immutable: full commit SHA, monotonic sequence, bounded timestamps, exact release artifact hashes.
  • Verify downloaded package manifests, IDs, Engine API compatibility, archive contents, hashes, and signatures before catalog construction.
  • Preserve least-privilege workflow permissions and ensure temporary key files are removed on every exit path.

Acceptance criteria

  • Publication workflows orchestrate tested scripts instead of containing the core catalog algorithm inline.
  • Pull requests can reproduce catalog output from fixtures without GitHub tokens or signing secrets.
  • Tests cover duplicate/replaced IDs, invalid manifests, incompatible Engine API ranges, bad hashes/sizes, invalid timestamps, non-monotonic sequence, existing release, and signature/envelope tampering.
  • First-party package versions come from an immutable reviewed BOM rather than workflow source edits.
  • Actions/shell syntax and workflow permissions are validated in CI.
  • Production publication verifies every input before exposing/using the signing key and leaves no key file behind.
  • README documents dry-run, production publication, rollback, and provenance verification.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions