Skip to content

fix(scarab): use GHCR_TRAINER_PAT for sovereign-scarab GHCR login#226

Open
gHashTag wants to merge 3 commits into
mainfrom
fix/scarab-ghcr-pat
Open

fix(scarab): use GHCR_TRAINER_PAT for sovereign-scarab GHCR login#226
gHashTag wants to merge 3 commits into
mainfrom
fix/scarab-ghcr-pat

Conversation

@gHashTag
Copy link
Copy Markdown
Owner

Summary

  • Switches the sovereign-scarab GHCR login step to the cross-repo PAT secrets.GHCR_TRAINER_PAT — the same proven-good credential the trainer publish workflow (docker-trainer.yml) uses to push ghcr.io/ghashtag/trios-trainer-igla on the same ghashtag/* user namespace.
  • The merged GITHUB_TOKEN login still fails on first push of ghcr.io/ghashtag/sovereign-scarab with permission_denied: write_package (workflow run 26019864970) even after repo default workflow permissions were set to write and the OCI image.source label was added (PRs fix(scarab): bump Dockerfile.scarab to rust:1.90 for edition2024 deps #223-fix(scarab): link GHCR package to repo via OCI image.source label #225). Reusing the trainer PAT is the minimal unblock — GHCR-side only.
  • Adds text-level regression guards in crates/trios-igla-race/tests/scarab_runtime_invariants.rs:
    • sovereign-scarab.yml must use secrets.GHCR_TRAINER_PAT
    • sovereign-scarab.yml must NOT use secrets.GITHUB_TOKEN
    • docker-trainer.yml remains the canonical PAT credential anchor

Not changed (ADR-0042 invariants preserved)

  • No Railway API / PAT / variableUpsert / serviceInstanceRedeploy / serviceDelete introduced. Scarab control plane is still SSOT (ssot.scarab_strategy), not Railway GraphQL.
  • Workflow still builds crates/trios-igla-race/Dockerfile.scarab, which still builds --bin scarab -p trios-igla-race.
  • provenance: false / sbom: false / OCI image.source label / both-level packages: write declarations all preserved (existing guards keep them locked).

Testing

  • YAML parses cleanly (python3 -c "import yaml; yaml.safe_load(...)").
  • No secrets.GITHUB_TOKEN references remain (grep).
  • CI runs scarab_runtime_invariants integration suite — new guards sovereign_scarab_workflow_uses_ghcr_trainer_pat_for_login and trainer_publish_workflow_anchors_ghcr_trainer_pat_credential must pass alongside the existing suite.
  • sovereign-scarab workflow run on main after merge pushes ghcr.io/ghashtag/sovereign-scarab:latest without permission_denied: write_package.

Anchor: phi^2 + phi^-2 = 3.
Agent: GENERAL

trios-agent added 3 commits May 18, 2026 08:14
The merged GITHUB_TOKEN path still fails on first push of
ghcr.io/ghashtag/sovereign-scarab with permission_denied: write_package
(run 26019864970), even after repo default workflow permissions were
set to write and the OCI image.source label was added (PRs #223-#225).

The trainer publish workflow has been pushing
ghcr.io/ghashtag/trios-trainer-igla on the same ghashtag/* user
namespace successfully using the cross-repo PAT secret
GHCR_TRAINER_PAT. Reuse it here — minimal unblock, GHCR-side only.

Read-only against Railway: no Railway API / PAT / variableUpsert /
redeploy / delete. ADR-0042 scarab control plane (ssot.scarab_strategy)
is untouched. Dockerfile.scarab target and --bin scarab build unchanged.

Regression guards added:
- sovereign-scarab.yml must use secrets.GHCR_TRAINER_PAT
- sovereign-scarab.yml must NOT use secrets.GITHUB_TOKEN
- docker-trainer.yml remains the canonical PAT anchor

Anchor: phi^2 + phi^-2 = 3.
Agent: GENERAL
Anchor: phi^2 + phi^-2 = 3.
Agent: GENERAL
The existing read-only guard does a substring match on the workflow YAML,
so even a comment that names `variableUpsert` etc. trips the assertion.
Rephrase the comment to keep the intent (no Railway control-plane writes)
without naming the forbidden symbols.

Anchor: phi^2 + phi^-2 = 3.
Agent: GENERAL
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.

1 participant