Skip to content

feat(#69): add lib-checked typecheck script and AGENTS.md policy - #70

Merged
shairevivo merged 2 commits into
mainfrom
agent/69-typecheck-agents-md
Nov 10, 2026
Merged

shairevivo merged 2 commits into
mainfrom
agent/69-typecheck-agents-md

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

This adds a typecheck npm script that checks third-party typings, and a repo-root AGENTS.md that records the TypeScript 4.9 dependency policy for agents and humans.

File Change
package.json New script: "typecheck": "tsc --project tsconfig.typecheck.json"
tsconfig.typecheck.json Extends tsconfig.json and sets skipLibCheck: false. build/start still use tsconfig.json, unchanged.
typecheck/ts4.9-shims.d.ts Global NoInfer fallback, loaded only by the typecheck config (see the exception below).
AGENTS.md "Dependency updates" section: why TS is held at 4.9, how to check typeScriptVersion and the ts4.9 dist-tag, the @types/node pin, the validation command, the missing CI, and the exit condition.

Why the script isn't just tsc --noEmit --skipLibCheck false

The issue suggested that literal command. On main (38faaa8) it fails with 7 errors, all in styled-components@6.6.0:

node_modules/styled-components/dist/constructors/constructWithOptions.d.ts(12,123): error TS2304: Cannot find name 'NoInfer'.
node_modules/styled-components/dist/constructors/css.d.ts(15,59): error TS2304: Cannot find name 'NoInfer'.
node_modules/styled-components/dist/types.d.ts(213,216): error TS2304: Cannot find name 'NoInfer'.
... (2 in constructWithOptions.d.ts, 3 in css.d.ts, 2 in types.d.ts)

This is the same TS-version problem, not an unrelated one. styled-components 6.5+ uses the global NoInfer utility type, which only exists in TypeScript 5.4+. Version 6.1.19 defined its own; 6.5.0 and 6.6.0 rely on the built-in. Today skipLibCheck: true hides it, so in the normal build those types quietly turn into any.

How it's scoped: typecheck/ts4.9-shims.d.ts declares type NoInfer<T> = [T][T extends any ? 0 : never], the same fallback styled-components exports from dist/utils/noInfer. Only tsconfig.typecheck.json includes it. Remove it when TypeScript is raised to 5.4 or later. AGENTS.md documents this. I didn't downgrade styled-components because that is outside this issue's scope.

No other .d.ts errors came up. Several auto-included typings declare typeScriptVersion 5.x but still lib-check cleanly under 4.9 (@types/react@19.3.0, @types/react-dom@19.3.0, @types/ws, @types/semver, @types/estree). So AGENTS.md calls typeScriptVersion advisory and treats npm run typecheck as the authoritative check. A strict "must declare ≤4.9" rule would already be broken on main by @types/react, which react@19 needs.

Testing

All runs used TypeScript 4.9.5 and Node 22.22.1.

  • npm run typecheck on this branch: passes (exit 0)
  • Negative check, npm install --no-save @types/node@22.20.5:
  • Negative check, npm install --no-save @types/jest@30.0.0 (PR chore(deps-dev): bump @types/jest from 27.4.1 to 30.0.0 #64): npm run typecheck fails. It reports TS2726 Cannot find lib definition for 'esnext.disposable' in the bundled jest-mock typings, plus TS2339 for the removed toBeCalledTimes alias in src/commons/Checkbox/Checkbox.test.tsx.
  • After restoring with npm ci, npm run typecheck passes again.
  • npm run lint, npm run build and CI=true npm test all pass: 19 suites, 40 tests, 13 snapshots.
  • prettier --check passes on all changed files. commitlint passes on the commit message.

Notes

  • Optional item 3 (@types/jest Dependabot ignore) is not included. The registry shows @types/jest's ts4.9 dist-tag is 29.5.14, and 30.0.0 declares typeScriptVersion 5.1. The triage noted that open PR ci(deps): label npm Dependabot PRs for the fullsend fix agent #68 also edits .github/dependabot.yml. To avoid a conflict, the guidance is in AGENTS.md instead: keep @types/jest on 27.x to match the jest@27 runtime from react-scripts 5, and 30.0.0 fails typecheck. A follow-up can add versions: [">=28"] if maintainers want it enforced.
  • No .github/workflows/ files are touched.
  • Open question carried over from triage: AGENTS.md only helps if the fullsend agents load the repo-root file. That has not been confirmed for this harness version.

🤖 Generated with Claude Code


Closes #69

Post-script verification

  • Branch is not main/master (agent/69-typecheck-agents-md)
  • Secret scan passed (gitleaks — 38faaa85ae9a8b518aba9eed734a8e7ce07869b9..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Final PR description secret scan passed (gitleaks — no-git)

tsconfig.json sets skipLibCheck, so `tsc` hides .d.ts errors caused by
the repo being held on TypeScript 4.9 (react-scripts 5 peer range).
@types/node 22.20.5 passed that way (#61) but fails with TS2502 when
lib checking is on.

- package.json: add `typecheck` (tsc --project tsconfig.typecheck.json).
- tsconfig.typecheck.json: extends tsconfig.json with
  skipLibCheck: false. build/start still use tsconfig.json unchanged.
- typecheck/ts4.9-shims.d.ts: styled-components 6.6.0 typings use the
  global NoInfer type (TS 5.4+), which made the lib-checked run fail
  on main with 7 TS2304 errors. Declare the same fallback that
  styled-components exports, loaded only by the typecheck config.
- AGENTS.md: document the TS 4.9 dependency policy, how to check
  typeScriptVersion and the ts4.9 dist-tag, the @types/node pin, the
  validation command, and the exit condition.

Verified: typecheck passes on main. With @types/node@22.20.5 plain
`tsc --noEmit` passes but `npm run typecheck` fails (TS2502). With
@types/jest@30.0.0 it fails too (TS2726). lint, build and
CI=true npm test pass.

.github/dependabot.yml is unchanged to avoid conflicting with #68;
the @types/jest guidance is recorded in AGENTS.md instead.

Closes #69

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Nov 10, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:40 PM UTC · Completed 1:07 PM UTC

Commit: 636257b · View workflow run →

Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $5.17

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 10, 2026
@fullsend-ai-review

Copy link
Copy Markdown

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Bot-authored docs-and-config PR with small blast radius and all acceptance criteria met; held at moderate rather than low because of one protected path (AGENTS.md), one dependency manifest touched (package.json, script-only), and package.json's high recent churn.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

Low

  • [logic-error] AGENTS.md:72 — The "Exit condition" section says to relax the shim in typecheck/ts4.9-shims.d.ts together with the other rules "when ... TypeScript 5 or later is otherwise allowed", but lines 54-55 (and the shim's own comment) say to delete the shim only when TypeScript is raised to 5.4 or later. TypeScript 5.0–5.3 has no built-in NoInfer, so following the exit condition as written would bring back the 7 TS2304 errors in npm run typecheck.
    Remediation: Make the shim bullet in the exit condition say it is removed only once the installed TypeScript is >= 5.4.
  • [logic-error] AGENTS.md:59 — The text says "Run all four and report each result", but the command on line 63 chains the steps with &&. If npm run typecheck fails, build and test never run, so an agent following the command cannot report all four results; a typecheck failure hides the build and test outcomes.
    Remediation: Run the four commands separately (one per line, or joined with ;) and record each exit code, or reword the instruction to say later steps are skipped after a failure.
  • [edge-case] typecheck/ts4.9-shims.d.ts:9 — The shim declares a global NoInfer type, and tsconfig.typecheck.json compiles it together with src. src code that uses NoInfer would therefore pass npm run typecheck, while react-scripts build/start/test (which use tsconfig.json, including only src) would fail with TS2304 — the inverse of the "typecheck is the stricter check" premise in AGENTS.md. No src file uses NoInfer today, so this is a latent risk.
    Remediation: Note in the shim comment and in AGENTS.md that src must not use NoInfer (or add a lint rule against it); the validation chain's npm run build step also catches it.

Labels: PR adds an AGENTS.md policy document and typecheck tooling, matching the documentation label on linked issue #69.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

@fullsend-ai-review fullsend-ai-review 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.

See the review comment for full details.

Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
Comment thread typecheck/ts4.9-shims.d.ts Resolved
@fullsend-ai-review fullsend-ai-review Bot added the documentation Improvements or additions to documentation label Nov 10, 2026
@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 1:08 PM UTC · Completed 1:13 PM UTC

Commit: 636257b · View workflow run →

Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $0.62

- AGENTS.md exit condition: remove the NoInfer shim only once TypeScript
  is >= 5.4, matching the shim's own comment (TS 5.0-5.3 lack NoInfer).
- AGENTS.md validation: list the four commands separately and say to run
  the last three even if one fails, so each result can be reported.
- Shim comment and AGENTS.md: note that src must not use NoInfer, since
  the shim hides it from typecheck while build/start/test would fail.

Not changed: the protected-path finding on AGENTS.md is a merge gate
that needs human approval, not a content edit.

Addresses #70

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (bot-triggered)

Fixed all three low-severity findings: the exit condition now removes the NoInfer shim only once TypeScript is 5.4 or later, the validation commands run separately so each result can be reported, and the shim comment and AGENTS.md say src must not use NoInfer. Disagreed with the protected-path finding because it is a merge gate that needs human approval. npm run typecheck, npm run lint and CI=true npm test (19 suites, 40 tests) pass, and prettier passes on the changed files.

Fixed (4):

  1. Conflict update: inspected forge mergeability: GitHub reports mergeable=MERGEABLE, so there is no conflict. No merge or rebase was done (outcome: skipped).
  2. [logic-error] AGENTS.md:72: the exit condition relaxes the NoInfer shim once TypeScript 5+ is allowed, but the shim is only safe to remove from TypeScript 5.4 (AGENTS.md): The exit-condition bullet now says to remove the shim only once the installed TypeScript is 5.4 or later, and notes that 5.0-5.3 have no built-in NoInfer.
  3. [logic-error] AGENTS.md:59: 'run all four and report each result' contradicts the &&-chained command (AGENTS.md): The four commands are now on separate lines, and the text says to run the last three even if an earlier one fails (stop only if npm ci fails), so each result can be reported.
  4. [edge-case] typecheck/ts4.9-shims.d.ts:9: the global NoInfer shim would let src code using NoInfer pass typecheck while build fails (typecheck/ts4.9-shims.d.ts): Added a note to the shim comment and to AGENTS.md that src must not use NoInfer, and that the npm run build validation step catches it.

Disagreed (1):

  1. [protected-path] AGENTS.md: human approval is required for protected-path changes: This is the mandatory merge-gate finding. It asks for human approval and does not prescribe a content edit, so the agent cannot resolve it. A human reviewer must approve the AGENTS.md change.

Tests: passed

CI inspections (3):

  1. security / Secret scan (gitleaks) (passing, success): Secret scan passed on the PR head.
  2. security / Production dependency audit (passing, success): Dependency audit passed on the PR head.
  3. merge agent PRs on clean review / merge-on-clean-review (passing, skipped): Skipped because the review requested changes. Not a failure.

Conflict update: skipped; strategy none; forge MERGEABLE; target main

Decision points
  • How to fix the validation-command contradiction (alternatives: Reword the text to say later steps are skipped after a failure, Run the commands separately so every result is reported; rationale: The section's goal is that the PR body reports the typecheck, build and test results. Running them separately keeps one failure from hiding the others.)
  • How to guard against NoInfer use in src (alternatives: Add an ESLint rule banning NoInfer, Document the restriction in the shim comment and AGENTS.md; rationale: Documentation was the remediation's first option and is the smaller change. The build step in the validation commands already catches a violation.)

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ❌ Failure (validation failed after 1 iteration(s)) · Started 1:14 PM UTC · Completed 1:21 PM UTC

Commit: f73a7db · View workflow run →

Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $2.92

@shairevivo

Copy link
Copy Markdown
Collaborator

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:28 PM UTC · Completed 1:37 PM UTC

Commit: f73a7db · View workflow run →

Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $3.75

@shairevivo
shairevivo merged commit a57ebe7 into main Nov 10, 2026
11 of 12 checks passed
@shairevivo
shairevivo deleted the agent/69-typecheck-agents-md branch November 10, 2026 13:34
@fullsend-ai-retro

fullsend-ai-retro Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 1:35 PM UTC · Completed 1:49 PM UTC

Commit: f73a7db · View workflow run →

Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $4.33

@fullsend-ai-review

Copy link
Copy Markdown

Review skipped — this PR is already merged.

The /fs-review command only reviews open PRs/MRs.

Posted by fullsend post-review check

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #70 (lib-checked typecheck script + AGENTS.md TS 4.9 policy, closes #69)

Timeline (2026-11-10, UTC): retro-filed #69 12:25 → triage 12:26–12:29 ($0.54) → code 12:30–12:39 ($1.10, 1 commit) → review 1 12:40–13:07 ($5.17, request-changes: 1 medium protected-path + 3 low, all valid) → fix 13:08–13:13 ($0.62) → review 2 13:14–13:22 failed (OIDC refresh 504 → stale token → no agent-result.json, $2.92) → owner /fs-review 13:27 → owner merged 13:34:50 while review 3 was running → review 3 finished 13:37 with a non-blocking comment verdict and was discarded. About $14.10 of agent spend, $11.84 of it on reviews. Agents repo: fullsend-ai/agents@v0.54.0 (87a43fc).

What went well: the code agent's work was strong. It found that the literal command in the issue fails on main (styled-components 6.5+ needs a built-in NoInfer, which arrived in TS 5.4). It scoped a shim to a separate tsconfig so build and start are unchanged, and it proved the new check catches both earlier false-greens (@types/node@22.20.5, @types/jest@30). Review 1's findings were accurate and the fix agent addressed all of them in one iteration. I found no correctness bug in the tsconfig or the shim.

Proposals filed (2): (1) the platform OIDC refresh loop does not retry on 5xx, which caused review 2's failure; (2) small AGENTS.md accuracy fixes in this repo.

Evidence for existing issues (not re-filed):

Other observations (no proposal):

Proposals filed

shairevivo pushed a commit that referenced this pull request Nov 10, 2026
* docs(#71): list @types/jest ignore rule, fix npm test claim

AGENTS.md drifted from .github/dependabot.yml: PR #64 added a
Dependabot ignore rule for @types/jest >=28 while PR #70 was open,
so the merged AGENTS.md never mentioned it.

- Pinned versions: note that Dependabot ignores @types/jest >=28,
  and document the react-scripts major-update ignore rule so every
  npm ignore entry is described.
- Exit condition: add the @types/jest rule, relaxed only when
  react-scripts/Jest 27 is replaced, not when only TypeScript is
  raised.
- NoInfer paragraph: only build and start type-check (via
  fork-ts-checker) and fail with TS2304; CI=true npm test uses
  babel-jest, which strips types, so it still passes. npm run build
  is the step that catches it.

Docs-only change. Verified with prettier 3.9.10 --check.

Closes #71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(#71): address review feedback on PR #72

Narrow the NoInfer guidance in AGENTS.md: `npm run build` catches a
NoInfer only in application code. CRA 5.0.1 configures fork-ts-checker
to skip test files (*.test.*, *.spec.*, __tests__/, setupTests.*,
setupProxy.*), so no validation command catches it there. Tell agents
not to use NoInfer in test files either.

The protected-path finding needs no change (human approval of the
AGENTS.md edit is a merge gate, not a content change).

Verification: npx prettier@3.9.10 --check AGENTS.md passes. npm test and
eslint were not run: documentation-only change and node_modules is not
installed in the sandbox.

Addresses #72

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: fullsend-code <278716306+fullsend-ai-coder[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation ready-for-review Triggers review agent dispatch risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document the TypeScript 4.9 dependency policy for agents and add a typecheck script that does not skip lib checks

1 participant