Skip to content

feat: harden GuardScan release distribution infrastructure - #36

Open
ntanwir10 wants to merge 23 commits into
review/1.1.0-catalogfrom
review/1.1.0-distribution
Open

feat: harden GuardScan release distribution infrastructure#36
ntanwir10 wants to merge 23 commits into
review/1.1.0-catalogfrom
review/1.1.0-distribution

Conversation

@ntanwir10

Copy link
Copy Markdown
Owner

Stack 3 of 4 for #32; depends on the preceding catalog PR. Review boundary: 3335331..7db43b8 (97 changed files). Adds dependency-ordered release distribution infrastructure, CI and package-channel safeguards, documentation, and path normalization. Automation and publication remain disabled.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 51 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: adab9ba4-36b3-409e-b6b6-fd95f0ce3235

📥 Commits

Reviewing files that changed from the base of the PR and between 3335331 and 7db43b8.

⛔ Files ignored due to path filters (1)
  • cli/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (96)
  • .github/release-ledger/README.md
  • .github/release-ledger/active-versions.json
  • .github/workflows/ci.yml
  • .github/workflows/release-build.yml
  • .github/workflows/release-canary.yml
  • .github/workflows/release-credential-health.yml
  • .github/workflows/release-first-withdrawal.yml
  • .github/workflows/release-please.yml
  • .github/workflows/release-publish.yml
  • .github/workflows/release-train.yml
  • .gitignore
  • PRIVACY.md
  • QUICKSTART.md
  • README.md
  • SECURITY.md
  • catalog/homebrew-tap/.github/workflows/verify.yml
  • catalog/homebrew-tap/README.md
  • cli/CHANGELOG.md
  • cli/README.md
  • cli/__tests__/contracts/documentation-command-contracts.test.ts
  • cli/__tests__/contracts/release-contracts.test.ts
  • cli/__tests__/contracts/telemetry-collector.contract.test.ts
  • cli/__tests__/core/telemetry.test.ts
  • cli/__tests__/integration/ai-providers-enhanced.test.ts
  • cli/__tests__/integration/rag-e2e.test.ts
  • cli/__tests__/providers/decorators/rate-limited-provider.test.ts
  • cli/__tests__/scripts/package-manager-smoke.test.ts
  • cli/__tests__/scripts/release-credential-monitor.test.ts
  • cli/__tests__/scripts/release-please-config.test.ts
  • cli/__tests__/scripts/release-renderers.test.ts
  • cli/__tests__/scripts/release-tool.test.ts
  • cli/__tests__/scripts/release-train.test.ts
  • cli/__tests__/scripts/release-workflows.test.ts
  • cli/__tests__/scripts/standalone-artifact.test.ts
  • cli/__tests__/scripts/standalone-builder.test.ts
  • cli/__tests__/utils/api-client.test.ts
  • cli/__tests__/utils/path-helper.test.ts
  • cli/__tests__/utils/private-state.test.ts
  • cli/__tests__/utils/runtime-capabilities.test.ts
  • cli/__tests__/utils/telemetry-client.test.ts
  • cli/docs/DEBUGGING.md
  • cli/docs/PERFORMANCE.md
  • cli/docs/TESTING_TOOLS.md
  • cli/package.json
  • cli/schemas/guardscan.channel-catalog.v1.schema.json
  • cli/schemas/guardscan.promotion-decision.v1.schema.json
  • cli/schemas/guardscan.release-event.v1.schema.json
  • cli/schemas/guardscan.release-manifest.v1.schema.json
  • cli/schemas/guardscan.release-state.v2.schema.json
  • cli/scripts/eslint-baseline.json
  • cli/scripts/eslint-ratchet-lib.js
  • cli/scripts/package-manager-smoke.js
  • cli/scripts/package-smoke.js
  • cli/scripts/release/candidate.js
  • cli/scripts/release/events.js
  • cli/scripts/release/first-release-withdrawal.js
  • cli/scripts/release/index.js
  • cli/scripts/release/lib.js
  • cli/scripts/release/promotion.js
  • cli/scripts/release/publication-evidence.js
  • cli/scripts/release/reconcile.js
  • cli/scripts/release/recovery-source.js
  • cli/scripts/release/renderers.js
  • cli/scripts/release/runtime-artifact-policy.js
  • cli/scripts/release/standalone-artifact.js
  • cli/scripts/release/standalone.js
  • cli/scripts/release/validators.js
  • cli/src/commands/capabilities.ts
  • cli/src/constants/api-constants.ts
  • cli/src/core/codebase-indexer.ts
  • cli/src/core/cost-guard.ts
  • cli/src/core/embedding-chunker.ts
  • cli/src/core/loc-counter.ts
  • cli/src/core/telemetry.ts
  • cli/src/index.ts
  • cli/src/utils/path-helper.ts
  • cli/src/utils/runtime-capabilities.ts
  • cli/src/utils/telemetry-client.ts
  • docs/AI_QUICK_REFERENCE.md
  • docs/API.md
  • docs/DOCKER_GUIDE.md
  • docs/FUNCTIONAL_ACCEPTANCE.md
  • docs/GETTING_STARTED.md
  • docs/RATE_LIMITING.md
  • docs/RELEASE_AUTOMATION.md
  • docs/RELEASE_ONBOARDING.md
  • docs/VULNERABILITY_SCANNING.md
  • docs/adrs/001-cloudflare-workers-backend.md
  • docs/adrs/003-privacy-first-architecture.md
  • docs/adrs/005-byok-ai-model.md
  • docs/adrs/006-node-sea-standalone-distribution.md
  • docs/adrs/007-retire-hosted-cloudflare-telemetry.md
  • docs/adrs/README.md
  • tasks/plan.md
  • tasks/session-handoff-2026-08-02.md
  • tasks/todo.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ntanwir10

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ntanwir10

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

git config user.name guardscan-release-bot
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add events active-versions.json
git commit -m "release ledger: ${RELEASE_TAG}" || exit 0
git push origin HEAD:release-ledger

P1 Badge Fail when the publication-ledger commit fails

In the publication-recording section, git commit ... || exit 0 treats every commit failure as the expected no-op case. If the commit fails because of a hook, repository corruption, identity/configuration error, or another unexpected Git error, the subshell exits successfully before the push, so the workflow can report success after publishing public artifacts without persisting their ledger events or active-train entry. Test whether the index is empty explicitly and allow only that case to skip the commit; propagate all actual commit failures.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +659 to 662
if (resolved.length === expectedCount) {
const types = ['winget', 'chocolatey'].includes(channel)
? ['channel_accepted', 'channel_verified']
: ['channel_verified'];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stop re-emitting terminal channel transitions

After the first successful hourly canary, each required channel is already verified, but the next run emits another run-specific channel_verified event here (and moderated channels emit channel_accepted first). materializeReleaseState does not allow verified -> verified or verified -> accepted, so the second scheduled RC canary makes the ledger unmaterializable; subsequent reconciliation and the required 24-hour promotion can no longer complete. Check the materialized channel status and append status transitions only when they actually advance or recover the channel.

Useful? React with 👍 / 👎.

Comment on lines +1089 to +1092
timestamp: existing?.timestamp || timestamp,
type: 'channel_published',
channel,
idempotencyKey,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve verified catalog state during reconciliation

When the first catalog reconciliation occurs after a successful Homebrew/Scoop canary, those channels are already verified, yet this step appends channel_published. The state machine permits published -> verified but not verified -> published, so this timing corrupts the ledger and the promotion step fails while materializing it. Reconciliation should avoid appending this publication transition once the channel has reached verified or another later terminal state.

Useful? React with 👍 / 👎.

Comment on lines +668 to +670
channel,
idempotencyKey: `${type}:${suffix}`,
payload: {
remoteIdentity: `${report.channel}:${version}`,
},
payload: {},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Include submission evidence in moderated acceptance events

On the first successful public WinGet or Chocolatey canary, this block emits channel_accepted with an empty payload. validateModerationEvent requires every moderated channel_accepted event to contain the artifact IDs, remote identity/digest, and canonical submission evidence, so appendEvent rejects the event before channel_verified can be recorded. As a result, a stable train cannot complete either moderated channel even when the package is publicly installable; reuse the provider-bound submission evidence already stored in the channel state when constructing this event.

Useful? React with 👍 / 👎.

for (const {file, report} of versionReports) {
if (report.status === 'pending') continue;
const suffix = `${process.env.GITHUB_RUN_ID}:${process.env.GITHUB_RUN_ATTEMPT}:${report.channel}:${report.target}:${path.basename(path.dirname(file))}`;
appendEvent(ledger, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep canary event timestamps monotonic

The report timestamp is captured in the matrix job, before the serialized ledger-writing job starts. If a scheduled reconciliation or another protected-ledger writer appends an event while the canary matrix is running or waiting for the release-ledger concurrency lock, this timestamp can precede the ledger's latest event; validateEvent then rejects it because release-event timestamps may not move backward. Use a timestamp at append time (or clamp it to the previous ledger timestamp) and retain the original check time separately if needed.

Useful? React with 👍 / 👎.

Comment on lines +1677 to +1681
for (const [channel, channelState] of Object.entries(state.channels)) {
if (!['github', 'pnpm', 'yarn', 'bun', 'homebrew', 'scoop'].includes(channel)
|| !['published', 'submitted', 'accepted', 'verified'].includes(channelState.status)) {
continue;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Supersede failed repository channels during rollback

When rollback is initiated after a canary has marked a repository-owned channel such as GitHub, Homebrew, or Scoop failed, this filter skips that channel even though the state machine explicitly permits failed -> superseded. The workflow then records repository recovery as complete and removes the defective train from active-versions.json, leaving the failed public channel non-terminal and no longer monitored. Include failed in the statuses that receive the rollback terminal event.

Useful? React with 👍 / 👎.

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