Skip to content

fix(ci): harden dependency watch contract#210

Merged
saagpatel merged 2 commits into
masterfrom
codex/fix/dependency-watch-contract-readback
Jul 12, 2026
Merged

fix(ci): harden dependency watch contract#210
saagpatel merged 2 commits into
masterfrom
codex/fix/dependency-watch-contract-readback

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

What

  • serialize the scheduled dependency-watch workflow and cap runtime at 30 minutes
  • verify created or updated alert issues by reading them back
  • emit a standalone AutomationTerminalStateV1 completion record with partial-failure accounting
  • add a contract test to the repository health checks

Why

The scheduled workflow could overlap, mutate an issue without destination readback, and finish without a machine-readable terminal state. That made successful execution distinguishable from neither partial writes nor broken output contracts.

How

The issue-writing step exposes its action and destination ID, fetches the resulting issue, and fails on title/body mismatch. The final always-run step records success, failure, skip, mutation count, and readback state.

Testing

  • node scripts/ci/check-dependency-watch-contract.mjs
  • node scripts/ci/check-workflow-command-drift.mjs
  • pnpm health:repo:checks
  • pnpm perf:bundle
  • pnpm perf:build
  • pnpm perf:lighthouse
  • pnpm perf:assets
  • pnpm perf:api blocked because BASE_URL is not configured
  • pnpm perf:db blocked because DATABASE_URL is not configured

Risks

Low. The issue mutation condition and issue content are unchanged. A readback mismatch now fails visibly instead of silently succeeding. Concurrent runs queue rather than cancel.

Performance impact

No product-runtime impact. The workflow adds one GitHub issue GET only when an alert issue is created or updated. Bundle, build, Lighthouse, and asset gates passed.

Lockfile rationale

No lockfile changes.

Screenshots

Not applicable; no UI changes.

@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

Here are some automated review suggestions for this pull request.

Reviewed commit: f3931da038

ℹ️ 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 +181 to +184
if (readback.data.title !== title || readback.data.body !== body) {
throw new Error(`Dependency alert issue readback mismatch for #${issueNumber}`);
}
core.setOutput('issue_action', issueAction);

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 Record mutation outputs before readback can fail

When the create/update call succeeds but issues.get fails or returns mismatched content, this throws before issue_action and issue_number are written. The always-run completion step then sees an attempted issue step with empty action/number and reports mutation_count:0 and destination_id:null, losing the partial mutation accounting the new terminal state is meant to provide. Set those outputs as soon as mutation.data.number is known, before the readback failure path.

Useful? React with 👍 / 👎.

@saagpatel saagpatel merged commit 22da04a into master Jul 12, 2026
18 checks passed
@saagpatel saagpatel deleted the codex/fix/dependency-watch-contract-readback branch July 12, 2026 19:04
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