Strengthen TypeScript contract checks and review - #619
Open
dsfaccini wants to merge 9 commits into
Open
Conversation
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Operational contract
This PR gives TypeScript changes two distinct lines of defense:
test-jsCI job through rootnpm run ciTypeScript Reviewworkflow afterCIsucceedsAPPROVEorREQUEST_CHANGESreview without code-write authorityDeterministic checks prove mechanical properties. The agent reviews semantic risks that are difficult to encode as compiler rules. The agent starts only after deterministic CI is green.
Deterministic checks added to
npm run ciThese run inside the existing
test-jsjob. This PR does not add duplicate CI jobs.exactOptionalPropertyTypes,noImplicitReturns,noPropertyAccessFromIndexSignatureno-explicit-any,no-unsafe-type-assertion,switch-exhaustiveness-check, and unused disable directivesdist/index.d.tstsdexact-signature assertionssetProviderDatasilently becomingunknownnpm packtarball checked by strictpublintand@arethetypeswrong/cliThe stricter policies exposed real issues that are fixed here rather than suppressed: absent optional properties are omitted, fallthrough returns are explicit, dynamic records use bracket access, and decoded provider JSON stays
unknownuntil validation produces precise internal and public types.Agent added after successful CI
TypeScript Reviewfrom.github/workflows/typescript-review.mdpydantic-aithrough the repository's.github/workflows/shared/pydantic.mdgithub/gh-aw@db25fdfdb4ad50c5b0d10de9977b709401760378, shared with the staged triage pilotcopilot/claude-sonnet-4-5copilot-requests: write; no repository LLM API-key secret.github/workflows/typescript-review.lock.yml, compiled only for this workflow with gh-aw v0.86.2AGENTIC_WORKFLOWS_ENABLEDrepository variable, currently enabledReusing the repository-local engine removes a duplicate gh-aw import cache and keeps both Pydantic AI workflows on one reviewable engine definition.
Eligibility and trust boundary
Before any PR code is checked out, eligibility proves all of the following:
TypeScript Reviewexists for this workflow and SHA;Only then does the workflow check out the resolved same-repository SHA. Fork code is never checked out or executed.
Review scope and writes
The prompt covers:
any,unknown, assertions, or suppressions;The agent job is read-only. Its only writes are gh-aw safe outputs targeted to the eligibility-resolved PR number:
APPROVEorREQUEST_CHANGESreview attributed to the current head SHA.The fresh threat-detection runner installs the same pinned Pydantic AI harness before it inspects agent output. Fallback issue creation is disabled. Reruns serialize on workflow, branch, and SHA. The eligibility marker prevents duplicate formal reviews for the same head.
What changes after merge
npm run cienforces all three public-package contract layers after the existing build, typecheck, lint, and coverage checks.Verification
npm run ci— passedmake all— passedpre-commit run --all-files— passedgh aw compile typescript-review --strict --validate --no-emitwith v0.86.2 — passedgh-aw v0.86.2 has an actionlint-wrapper defect: it filters the generated
copilot-requestsandconcurrency.queueextension syntax to zero findings, then exits nonzero in strict mode. Direct actionlint v1.7.12 does not yet recognize those GitHub/gh-aw extensions. The same generated syntax is already present in the merged triage pilot lock.