Skip to content

chore: simplify-review fixes — date-ref, enum source-of-truth, TOCTOU guard#43

Merged
heznpc merged 1 commit into
mainfrom
chore/simplify-review-fixes
May 20, 2026
Merged

chore: simplify-review fixes — date-ref, enum source-of-truth, TOCTOU guard#43
heznpc merged 1 commit into
mainfrom
chore/simplify-review-fixes

Conversation

@heznpc

@heznpc heznpc commented May 20, 2026

Copy link
Copy Markdown
Member

Summary

Fixes from the /simplify review of this session's 7 prior PRs.

Fixed

# File Change
1 .github/workflows/ci.yml Remove (see 2026-05-21 modernization audit) — task dates belong in commit messages, not shipped code. Reworded rationale to explain why the audit threshold is moderate.
2 src/mcp-schemas.ts Derive 8 zod enum tuples from audit*.ts union types via as const satisfies readonly T[]. Single source of truth for ShipVerdict, WorkflowKind, ConfidenceLevel, CdStatus, CdVerdict, DestinationName, CheckStatus, SecurityCheckName.
3 .github/workflows/update-changelog.yml Idempotency guard: if chore/changelog-${TAG} branch already exists (re-published release, workflow re-run), exit with a notice instead of force-pushing or failing.

Skipped (acceptable as-is)

  • as unknown as Record<string, unknown> cast in src/index.ts — unavoidable with current SDK signature + our strongly-typed AuditReport interfaces.
  • ci.yml matrix gating via if: matrix.node-version == 22 — 4 instances of a 1-line conditional; splitting into a separate lint job adds job cold-start overhead for no net win on a 2-version matrix.
  • tsconfig "incremental": true + .tsbuildinfo cache — codebase too small for measurable benefit.

Test plan

  • npm run build clean
  • npm test — 85/85 pass
  • satisfies checks compile against current audit*.ts types
  • CI green

… guard

Three findings from the /simplify review of this session's changes:

1. .github/workflows/ci.yml — remove '(see 2026-05-21 modernization audit)'
   from the npm-audit comment. Task dates belong in commit messages and PR
   bodies, not in shipped code. Reworded the rationale to explain WHY the
   threshold is moderate (overrides patch MCP SDK transitives) rather than
   referencing the audit doc.

2. src/mcp-schemas.ts — derive zod enum tuples from the audit*.ts union
   types via 'as const satisfies readonly T[]' for ShipVerdict, WorkflowKind,
   ConfidenceLevel, CdStatus, CdVerdict, DestinationName, CheckStatus, and
   SecurityCheckName. The compile-time check catches typos and array-extra
   drift. Type-extra drift (new variant added in audit*.ts but not mirrored
   here) still surfaces at runtime as a structured-content validation error
   on first emission, which is loud — not silent — drift.

3. .github/workflows/update-changelog.yml — guard against duplicate-PR
   races when a release is re-published. If the per-tag branch
   'chore/changelog-${TAG}' already exists, exit with a notice instead
   of force-pushing or failing the workflow.

Skipped findings (documented as acceptable):
- 'as unknown as Record<string, unknown>' cast in src/index.ts: unavoidable
  with current SDK signature + our strongly-typed AuditReport interfaces.
- ci.yml matrix gating via 'if: matrix.node-version == 22': 4 instances of
  a 1-line conditional; splitting into a separate lint job would add job
  cold-start overhead and a publish.yml dependency change for no net win.
- tsconfig 'incremental: true' + tsbuildinfo cache: codebase too small for
  measurable benefit.
@heznpc
heznpc enabled auto-merge (squash) May 20, 2026 23:44
@heznpc
heznpc merged commit 75fb12d into main May 20, 2026
5 checks passed
@heznpc
heznpc deleted the chore/simplify-review-fixes branch May 20, 2026 23:45
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