Skip to content

[limen CIFIX-organvm-i-theoria--github] Fix pre-existing CI breakage (tsc/test-matrix errors) blocking all open PRs in organvm-i-theoria/.github - #458

Open
4444J99 wants to merge 1 commit into
mainfrom
limen/cifix-organvm-i-theoria--github-64ce
Open

[limen CIFIX-organvm-i-theoria--github] Fix pre-existing CI breakage (tsc/test-matrix errors) blocking all open PRs in organvm-i-theoria/.github#458
4444J99 wants to merge 1 commit into
mainfrom
limen/cifix-organvm-i-theoria--github-64ce

Conversation

@4444J99

@4444J99 4444J99 commented Jun 19, 2026

Copy link
Copy Markdown
Member

Autonomous limen dispatch of task CIFIX-organvm-i-theoria--github.

The test-matrix CI job fails with tsc/type errors on EVERY open PR (pre-existing on the default branch, not introduced by the PRs). Run the type-check/tests, fix the errors with minimal type-only changes so CI goes green; this unblocks the repo's open PR stack. Don't change runtime behavior.

Produced in an isolated worktree off origin — review before merge.

Summary by Sourcery

Add TypeScript configuration and minimal React typings to fix CI type-check failures without changing runtime behavior.

New Features:

  • Introduce npm scripts for running TypeScript type checks.

Enhancements:

  • Add a strict TypeScript compiler configuration and project includes for the dashboard codebase.
  • Define lightweight React and JSX .d.ts typings to satisfy the type checker and support the PredictiveWidget component.
  • Refine PredictiveWidget to use the locally defined React FC type alias instead of React.FC.

Build:

  • Add TypeScript as a devDependency and lockfile updates to support type checking in CI.

Summary by CodeRabbit

  • Chores
    • Added TypeScript tooling and configuration to support type-safe development.
    • Introduced npm scripts for running type checks during the development workflow.
    • Added TypeScript as a development dependency.

…en PRs in organvm-i-theoria/.github

limen task CIFIX-organvm-i-theoria--github
@sourcery-ai

sourcery-ai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Reviewer's Guide

Restores CI by adding a minimal TypeScript toolchain and local React/JSX typings, plus a small refactor of PredictiveWidget to rely on the new FC type, without changing runtime behavior.

Flow diagram for new TypeScript CI type-check pipeline

flowchart LR
  DevRun[npm run type-check] --> NpmScripts[type-check script]
  NpmScripts --> TypecheckScript[tsc --noEmit]
  TypecheckScript --> Tsconfig[tsconfig.json strict config]
  TypecheckScript --> Sources[src TS/TSX files]
  Sources --> PredictiveWidget[PredictiveWidget.tsx uses FC]
  Sources --> LocalReactTypes[types.d.ts React and JSX declarations]
  TypecheckScript --> TypecheckResult[CI type-check succeeds]
Loading

File-Level Changes

Change Details Files
Introduce TypeScript tooling and typecheck scripts to the project.
  • Add npm scripts to run TypeScript type-checking with no emit.
  • Add TypeScript as a devDependency for local type-checking.
  • Commit the updated package-lock.json reflecting the new dependency.
package.json
package-lock.json
Define minimal local React and JSX typings required for dashboard components to type-check.
  • Add a .d.ts file declaring CSS modules to satisfy style imports.
  • Define a minimal React module with FC, state hooks, and a default export suitable for JSX usage.
  • Define a permissive JSX namespace with IntrinsicElements to allow JSX without full React type packages.
src/automation/dashboard/types.d.ts
Align PredictiveWidget component with the new locally-defined React FC typing.
  • Import FC from the locally-defined React typings as a type-only import.
  • Change the component type annotation from React.FC to FC to remove reliance on undeclared React global types.
src/automation/dashboard/PredictiveWidget.tsx
Configure the TypeScript compiler to strictly type-check the dashboard sources without emitting JavaScript.
  • Create a tsconfig.json with strict type-checking, modern ES/DOM libs, and JSX preserved.
  • Limit TS inclusion to source .ts/.tsx/.d.ts files under src to avoid pulling in unrelated paths.
  • Enable module settings appropriate for a modern bundler while skipping lib checks to keep the configuration lightweight.
tsconfig.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

Copy link
Copy Markdown
Contributor

Version Control Standards Validation Failed

This pull request does not meet our version control standards.

Common Issues:

  1. Branch Name: Must follow format <lifecycle>/<type>/<component>[/<subcomponent>]

    • Examples:
      • develop/feature/user-authentication
      • production/hotfix/critical-security-fix
      • maintenance/v1.x/security-patches
  2. Commit Messages: Must follow Conventional Commits format

    • Format: <type>(<scope>): <subject>
    • Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
    • Examples:
      • feat(auth): add OAuth2 authentication
      • fix: resolve memory leak
      • docs: update installation guide

Documentation:

Please update your branch name and/or commit messages to follow the standards.

@github-actions

Copy link
Copy Markdown
Contributor

💡 Tip: Link Related Issues

We noticed this PR doesn't reference any issues. If this PR addresses an existing issue, please link it using:

  • Fixes #123 (for bug fixes)
  • Closes #123 (for feature implementations)
  • Relates to #123 (for related work)

This helps track the relationship between issues and PRs.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewers Assigned

Reviewers have been automatically assigned based on the CODEOWNERS file.

What's Next:

  • Reviewers will be notified
  • Please respond to any feedback
  • Ensure all CI checks pass
  • Reviews typically completed within 48 hours

Need Help?


Automated reviewer assignment - PR #458

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Hi @4444J99, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@github-actions github-actions Bot added configuration Configuration changes dependencies Pull requests that update a dependency file typescript labels Jun 19, 2026
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

🚨 Task Catcher Summary

🚨 BLOCKERS FOUND - Address before merging

📋 Task Overview

Category Count
PR Body Unchecked Tasks 0
PR Body Checked Tasks 0 ✅
Comment Tasks 0
Blocker Items 1 🚨
Suggestions 1 💡
Unresolved Review Threads 5

💬 Comment Tasks & Blockers

Issue Comments

🚨 @ - BLOCKER

❓ Inconclusive | The title references fixing CI breakage and tsc errors but includes unclear prefix '[limen CIFIX-organvm-i-theoria--github]' and vague internal naming that obscures the main change. | Simplify to focus on the primary change: 'Fix TypeScript type-checking errors blocking CI' or 'Add TypeScript configuration to fix CI type-checking errors'. |

💡 @ - Suggestion

const React in ambient module should be declare const React

Review Comments


🎯 Next Steps

  • 🚨 Address all blocker items before merging
  • 💬 Resolve review discussion threads

Options:

  • ✅ Check off tasks as you complete them
  • 📋 Create issues for tasks to handle later: Add create-issues-for-tasks label
  • 🚫 Ignore tasks for merge: Add ignore-task-checks label

Last scanned: 2026-07-19 08:42 UTC
Triggered by: issue_comment

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR bootstraps TypeScript type-checking: a tsconfig.json is added with strict settings targeting ES2020, typescript@5.8.3 is added as a dev dependency, and two npm scripts (typecheck, type-check) are wired to tsc --noEmit. Ambient declarations for CSS modules, a minimal React surface, and a JSX namespace are introduced, and PredictiveWidget is updated to use the directly imported FC type.

Changes

TypeScript Infrastructure

Layer / File(s) Summary
tsconfig and npm scripts/dependency
tsconfig.json, package.json
tsconfig.json is created with strict mode, ES2020 target, ESNext module resolution, noEmit, and src/ file inclusion. package.json adds typescript@5.8.3 to devDependencies and registers typecheck (tsc --noEmit) and type-check (alias) scripts.
Ambient declarations and component annotation
src/automation/dashboard/types.d.ts, src/automation/dashboard/PredictiveWidget.tsx
types.d.ts declares an untyped *.css module, a minimal ambient react module exporting FC, state/dispatch types, hooks, and a default React object, plus a permissive JSX namespace. PredictiveWidget.tsx adds a type-only FC import and switches its annotation from React.FC to FC.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop hop, the types are set,
A tsconfig fresh, no errors yet.
FC imported clean and bright,
CSS modules silent in the night.
Strict mode on, the rabbit cheers —
TypeScript finally appears! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title references fixing CI breakage and tsc errors but includes unclear prefix '[limen CIFIX-organvm-i-theoria--github]' and vague internal naming that obscures the main change. Simplify to focus on the primary change: 'Fix TypeScript type-checking errors blocking CI' or 'Add TypeScript configuration to fix CI type-checking errors'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch limen/cifix-organvm-i-theoria--github-64ce

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 and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

Version Control Standards Validation Failed

This pull request does not meet our version control standards.

Common Issues:

  1. Branch Name: Must follow format <lifecycle>/<type>/<component>[/<subcomponent>]

    • Examples:
      • develop/feature/user-authentication
      • production/hotfix/critical-security-fix
      • maintenance/v1.x/security-patches
  2. Commit Messages: Must follow Conventional Commits format

    • Format: <type>(<scope>): <subject>
    • Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
    • Examples:
      • feat(auth): add OAuth2 authentication
      • fix: resolve memory leak
      • docs: update installation guide

Documentation:

Please update your branch name and/or commit messages to follow the standards.

@github-actions

Copy link
Copy Markdown
Contributor

💡 Tip: Link Related Issues

We noticed this PR doesn't reference any issues. If this PR addresses an existing issue, please link it using:

  • Fixes #123 (for bug fixes)
  • Closes #123 (for feature implementations)
  • Relates to #123 (for related work)

This helps track the relationship between issues and PRs.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​typescript@​5.8.3100100909390

View full report

@github-actions

Copy link
Copy Markdown
Contributor

💡 Tip: Link Related Issues

We noticed this PR doesn't reference any issues. If this PR addresses an existing issue, please link it using:

  • Fixes #123 (for bug fixes)
  • Closes #123 (for feature implementations)
  • Relates to #123 (for related work)

This helps track the relationship between issues and PRs.

@github-actions

Copy link
Copy Markdown
Contributor

Version Control Standards Validation Failed

This pull request does not meet our version control standards.

Common Issues:

  1. Branch Name: Must follow format <lifecycle>/<type>/<component>[/<subcomponent>]

    • Examples:
      • develop/feature/user-authentication
      • production/hotfix/critical-security-fix
      • maintenance/v1.x/security-patches
  2. Commit Messages: Must follow Conventional Commits format

    • Format: <type>(<scope>): <subject>
    • Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
    • Examples:
      • feat(auth): add OAuth2 authentication
      • fix: resolve memory leak
      • docs: update installation guide

Documentation:

Please update your branch name and/or commit messages to follow the standards.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces TypeScript to the project by adding the typescript dependency, setting up a tsconfig.json configuration, adding type-checking scripts, and refactoring PredictiveWidget.tsx to use imported FC types. The reviewer feedback highlights that the manual mock type declarations for React and JSX in types.d.ts are fragile and recommends replacing them by installing the official @types/react package instead.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +3 to +31
declare module "react" {
export type FC<P = Record<string, never>> = (props: P) => JSX.Element | null;

export type SetStateAction<S> = S | ((previousState: S) => S);
export type Dispatch<A> = (value: A) => void;

export function useEffect(
effect: () => void | (() => void),
dependencies?: readonly unknown[],
): void;

export function useState<S>(
initialState: S | (() => S),
): [S, Dispatch<SetStateAction<S>>];

const React: {
createElement: (...arguments_: unknown[]) => JSX.Element;
};

export default React;
}

declare namespace JSX {
interface Element {}

interface IntrinsicElements {
[elementName: string]: any;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Manually declaring mock types for react and JSX is highly fragile and discouraged. It lacks complete type definitions for React's full API (such as other hooks, refs, event handlers, etc.) and will easily break or conflict if standard React types are introduced later. It is highly recommended to install @types/react as a devDependency instead of maintaining custom mock types.

Comment thread package.json
Comment on lines +39 to +40
"prettier": "3.8.1",
"typescript": "5.8.3"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To avoid manually maintaining fragile mock types for React, add @types/react to your devDependencies and remove the custom react module declarations from types.d.ts. Remember to run npm install to update package-lock.json accordingly.

    "@types/react": "^18.3.12",
    "prettier": "3.8.1",
    "typescript": "5.8.3"

@github-actions

Copy link
Copy Markdown
Contributor

🤖 I'm sorry @4444J99, but I was unable to process your request. Please see the logs for more details.

@github-actions
github-actions Bot enabled auto-merge June 19, 2026 03:08
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Auto-Merge Enabled

This PR has been configured for automatic merging. It will be merged automatically when:

  • ✅ All required status checks pass
  • ✅ Required approvals are obtained
  • ✅ No merge conflicts exist

To disable auto-merge, add the needs-review label or [skip-auto-merge] to the title.

@sourcery-ai sourcery-ai 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.

Hey - I've left some high level feedback:

  • The custom react module declaration in types.d.ts is very minimal and overrides the real typings; consider at least including common props like children on FC (and defining a simple ReactNode) to avoid surprising type errors for future components that expect children.
  • The JSX.IntrinsicElements index signature is any, which largely defeats the benefit of turning on strict; if practical, narrow this to a more specific type (or at least Record<string, JSX.Element | any[]>) so obvious typos in tag names or attributes are caught.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The custom `react` module declaration in `types.d.ts` is very minimal and overrides the real typings; consider at least including common props like `children` on `FC` (and defining a simple `ReactNode`) to avoid surprising type errors for future components that expect children.
- The `JSX.IntrinsicElements` index signature is `any`, which largely defeats the benefit of turning on `strict`; if practical, narrow this to a more specific type (or at least `Record<string, JSX.Element | any[]>`) so obvious typos in tag names or attributes are caught.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Integration Test Results

Test Suite Status
Month 1 Core Workflows ✅ Passed
Month 2 Features ✅ Passed
Month 3 Advanced ✅ Passed
Critical Path ✅ Passed

Overall: ✅ All tests passed!

View detailed test reports

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Auto-Merge Enabled

This PR has been configured for automatic merging. It will be merged automatically when:

  • ✅ All required status checks pass
  • ✅ Required approvals are obtained
  • ✅ No merge conflicts exist

To disable auto-merge, add the needs-review label or [skip-auto-merge] to the title.

@claude

claude Bot commented Jun 19, 2026

Copy link
Copy Markdown

Code Review

This PR takes a pragmatic approach to fixing pre-existing CI failures by adding minimal TypeScript infrastructure. The goal (unblock other PRs without changing runtime behavior) is achieved, but there are several issues worth addressing.


Bugs / Correctness

package-lock.json integrity hash
The SHA-512 hash for typescript@5.8.3 should be verified against the canonical npm registry value. Please regenerate cleanly with npm install typescript@5.8.3 --save-dev and commit the result to ensure the lockfile is trustworthy.

types.d.ts: const inside declare module should be declare const

Inside an ambient declare module block, value declarations should use declare const. Without it, TypeScript may treat this as a concrete value rather than an ambient declaration, which can produce unexpected errors in strict mode:

// current
const React: { createElement: (...arguments_: unknown[]) => JSX.Element };

// should be
declare const React: { createElement: (...arguments_: unknown[]) => JSX.Element };

Code Quality

Duplicate scripts in package.json

Both typecheck and type-check do the same thing. Pick one canonical name and remove the alias — having both creates ambiguity for future contributors and CI config.

moduleResolution: "Node" is deprecated (tsconfig.json)

"Node" uses the legacy CommonJS resolution algorithm. For a config with "module": "ESNext", the idiomatic choice is "moduleResolution": "Bundler" (TypeScript 5+) or "Node16". The mismatch can produce confusing diagnostics when module paths are resolved differently at type-check vs. bundle time.

Minimal React stubs vs. @types/react (types.d.ts)

The custom declare module "react" stub satisfies the checker today, but:

  • FC<P> is simplified — the real type includes displayName, propTypes, etc., so code relying on those will silently pass type-check.
  • JSX.Element is an empty {} interface, weakening JSX type coverage.
  • If @types/react is ever added (e.g., by Dependabot), this ambient module will conflict.

A short comment explaining why stubs are preferred over @types/react would help future maintainers avoid inadvertently breaking this setup.


Security

No security concerns — all changes are dev-only, type-level additions with zero runtime impact.


Test Coverage

No tests added or removed, which is appropriate given the stated scope. Confirming npm run type-check passes cleanly (as a visible CI check result) would close the loop on the stated goal.


Summary

Severity Issue
Medium Verify package-lock.json SHA-512 integrity hash matches npm registry
Low const React in ambient module should be declare const React
Low Remove duplicate typecheck / type-check script alias
Low moduleResolution: "Node" is deprecated for ESNext module targets
Info Document rationale for stub typings over @types/react

The runtime-behavior constraint is met and the minimal-footprint approach is sound for unblocking CI. The integrity hash verification and the declare const correction are the items I'd want resolved before merge.

@github-actions

Copy link
Copy Markdown
Contributor

💡 Tip: Link Related Issues

We noticed this PR doesn't reference any issues. If this PR addresses an existing issue, please link it using:

  • Fixes #123 (for bug fixes)
  • Closes #123 (for feature implementations)
  • Relates to #123 (for related work)

This helps track the relationship between issues and PRs.

@github-actions

Copy link
Copy Markdown
Contributor

Version Control Standards Validation Failed

This pull request does not meet our version control standards.

Common Issues:

  1. Branch Name: Must follow format <lifecycle>/<type>/<component>[/<subcomponent>]

    • Examples:
      • develop/feature/user-authentication
      • production/hotfix/critical-security-fix
      • maintenance/v1.x/security-patches
  2. Commit Messages: Must follow Conventional Commits format

    • Format: <type>(<scope>): <subject>
    • Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
    • Examples:
      • feat(auth): add OAuth2 authentication
      • fix: resolve memory leak
      • docs: update installation guide

Documentation:

Please update your branch name and/or commit messages to follow the standards.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/automation/dashboard/types.d.ts`:
- Around line 3-31: The ambient type declarations for the `react` module and
`JSX` namespace are overly permissive and incomplete, with `IntrinsicElements`
typed as `any` which bypasses type checking for JSX elements. Either add `react`
and `@types/react` as proper dependencies in the project and remove these entire
ambient declarations (the `declare module "react"` block and the `declare
namespace JSX` block), or if these minimal stubs are intentional, add a
comprehensive comment at the top of the file explaining that these are temporary
placeholder definitions and should be replaced with proper React type
dependencies if `react` or `@types/react` are ever added to the project
dependencies. Do not leave these declarations in place without clear
documentation since they will silently shadow real React types and create
confusion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dbc612d6-d200-41cf-961e-8806b21ec4dd

📥 Commits

Reviewing files that changed from the base of the PR and between 53348cf and af9232b.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • package.json
  • src/automation/dashboard/PredictiveWidget.tsx
  • src/automation/dashboard/types.d.ts
  • tsconfig.json

Comment on lines +3 to +31
declare module "react" {
export type FC<P = Record<string, never>> = (props: P) => JSX.Element | null;

export type SetStateAction<S> = S | ((previousState: S) => S);
export type Dispatch<A> = (value: A) => void;

export function useEffect(
effect: () => void | (() => void),
dependencies?: readonly unknown[],
): void;

export function useState<S>(
initialState: S | (() => S),
): [S, Dispatch<SetStateAction<S>>];

const React: {
createElement: (...arguments_: unknown[]) => JSX.Element;
};

export default React;
}

declare namespace JSX {
interface Element {}

interface IntrinsicElements {
[elementName: string]: any;
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Inspecting react-related deps in package.json"
python - <<'PY'
import json
p=json.load(open("package.json"))
for section in ("dependencies","devDependencies","peerDependencies"):
    d=p.get(section,{})
    for k,v in d.items():
        if k in ("react","react-dom","`@types/react`","`@types/react-dom`"):
            print(f"{section}.{k}={v}")
PY

echo
echo "Searching for additional ambient React/JSX declarations"
rg -n --glob '**/*.d.ts' 'declare module "react"|declare namespace JSX|interface IntrinsicElements' -C2

Repository: organvm-i-theoria/.github

Length of output: 927


🏁 Script executed:

# Check what files in src/automation/dashboard actually use React/JSX
echo "=== Files importing React in src/automation/dashboard ==="
rg -n 'import.*react|from.*react|JSX\.' src/automation/dashboard --type ts --type tsx

echo
echo "=== TypeScript configuration ==="
cat tsconfig.json | head -50

echo
echo "=== Files in src/automation/dashboard directory ==="
find src/automation/dashboard -type f \( -name '*.ts' -o -name '*.tsx' \)

Repository: organvm-i-theoria/.github

Length of output: 705


🏁 Script executed:

# Look at the actual tsx file to see if it uses React/JSX
echo "=== Content of PredictiveWidget.tsx ==="
cat -n src/automation/dashboard/PredictiveWidget.tsx

echo
echo "=== Full content of types.d.ts ==="
cat -n src/automation/dashboard/types.d.ts

echo
echo "=== Check if types.d.ts is imported/referenced anywhere ==="
rg -n 'types\.d' src/

Repository: organvm-i-theoria/.github

Length of output: 9548


Custom ambient react + permissive JSX typings create type-safety gaps and potential conflicts.

The file defines a partial react module and JSX.IntrinsicElements as any. While these declarations currently fill a gap (no react/@types/react in dependencies), the permissive IntrinsicElements typing allows invalid JSX elements and incorrect props without catching errors. Additionally, the minimal type definitions for useState, useEffect, and SetStateAction don't match real React behavior (e.g., missing overloads for dependency arrays, conditional typing). If react or @types/react are added as dependencies later, these ambient declarations will silently shadow the real typings, creating confusion and inconsistency.

Either add official React dependencies (react, @types/react) and remove these ambient declarations, or add a comment documenting that these are intentional minimal stubs and should be updated if real React is added.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/automation/dashboard/types.d.ts` around lines 3 - 31, The ambient type
declarations for the `react` module and `JSX` namespace are overly permissive
and incomplete, with `IntrinsicElements` typed as `any` which bypasses type
checking for JSX elements. Either add `react` and `@types/react` as proper
dependencies in the project and remove these entire ambient declarations (the
`declare module "react"` block and the `declare namespace JSX` block), or if
these minimal stubs are intentional, add a comprehensive comment at the top of
the file explaining that these are temporary placeholder definitions and should
be replaced with proper React type dependencies if `react` or `@types/react` are
ever added to the project dependencies. Do not leave these declarations in place
without clear documentation since they will silently shadow real React types and
create confusion.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Auto-Merge Enabled

This PR has been configured for automatic merging. It will be merged automatically when:

  • ✅ All required status checks pass
  • ✅ Required approvals are obtained
  • ✅ No merge conflicts exist

To disable auto-merge, add the needs-review label or [skip-auto-merge] to the title.

@llamapreview llamapreview 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.

AI Code Review by LlamaPReview

🎯 TL;DR & Recommendation

Recommendation: Approve with suggestions

This PR fixes pre-existing CI type-check failures by adding TypeScript configuration and minimal type definitions, unblocking all open PRs. While the custom React type stubs work for now, they introduce long-term maintainability risks that should be addressed.

📄 Documentation Diagram

This diagram documents the new TypeScript type-check workflow added to CI.

sequenceDiagram
    participant Dev as Developer
    participant CI as CI Pipeline
    participant TSC as TypeScript Compiler

    Dev->>CI: Push code
    CI->>TSC: npm run typecheck
    note over TSC: PR #35;458 added typecheck script
    TSC->>TSC: Compile with tsconfig.json
    TSC-->>CI: Pass / Fail
    CI-->>Dev: Report status
Loading

🌟 Strengths

  • Minimal, targeted changes that do not alter runtime behavior.
  • Unblocks the entire open PR stack by making CI green.

💡 Suggestions (P2)

  • src/automation/dashboard/types.d.ts: The custom React module declaration is incomplete and may conflict with future @types/react installation. Consider replacing with the official @types/react package.
  • src/automation/dashboard/types.d.ts: The JSX namespace definitions are overly permissive, reducing type safety for JSX code. These would be resolved by adopting @types/react.

💡 Have feedback? We'd love to hear it in our GitHub Discussions.
✨ This review was generated by LlamaPReview Advanced, which is free for all open-source projects. Learn more.

Comment on lines +3 to +6
declare module "react" {
export type FC<P = Record<string, never>> = (props: P) => JSX.Element | null;

export type SetStateAction<S> = S | ((previousState: S) => S);

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 | Confidence: High

The PR adds a hand-written ambient module declaration for "react" instead of installing the official @types/react package. This custom declaration is necessarily incomplete: it omits hooks like useRef, useContext, useMemo, lifecycle types, and the full signature of useEffect (missing return type of void). Any code that uses these omitted features will receive a type error unless the declaration is extended. Furthermore, if @types/react is installed in the future, this declare module will conflict with it (TypeScript treats module augmentations in .d.ts files as augmentations, not replacements, leading to duplicate identifier errors). The current approach locks the codebase into a fragile, manually maintained type stub that will diverge from the real React type definitions. The proper fix is to remove this file and add @types/react as a devDependency, which provides complete and version‑managed types.
(This observation is absence‑based because the issue is the lack of the correct dependency; the custom types are a workaround that introduces long‑term risk.)

Code Suggestion:

// package.json (devDependencies)
"devDependencies": {
  "prettier": "3.8.1",
  "typescript": "5.8.3",
  "@types/react": "^18.2.0"
}

Evidence: search:declare module "react"

Comment on lines +25 to +30
declare namespace JSX {
interface Element {}

interface IntrinsicElements {
[elementName: string]: any;
}

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 | Confidence: Medium

The JSX.Element is defined as an empty interface – any object can be assigned to it, which defeats type‑checking of JSX return values. The JSX.IntrinsicElements index signature [elementName: string]: any allows any HTML/component element name with any props, making the type system blind to misspelled elements or invalid property names. While these permissive definitions are sufficient to silence the immediate tsc errors, they reduce the value of TypeScript’s static analysis for the JSX codebase. Future developers will lose the safety net that catches common JSX mistakes (e.g., <img sr={...}> instead of src). The proper solution is to rely on @types/react, which provides accurate JSX types derived from the actual React runtime.

Code Suggestion:

// Remove the custom JSX namespace entirely once @types/react is installed.
// @types/react provides:
//   type ReactElement<P, T> = ...
//   interface IntrinsicElements { ... }

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Auto-Merge Enabled

This PR has been configured for automatic merging. It will be merged automatically when:

  • ✅ All required status checks pass
  • ✅ Required approvals are obtained
  • ✅ No merge conflicts exist

To disable auto-merge, add the needs-review label or [skip-auto-merge] to the title.

@4444J99

4444J99 commented Jul 19, 2026

Copy link
Copy Markdown
Member Author

Backlog engagement 2026-07-19 — disposition: superseded by current main CI/type-check repair.

Verified live state: MERGEABLE/BLOCKED with failures in CI, dependency-review, build-and-push, lint, title, version-control, review, and welcome. The core type-checking artifacts from this branch (tsconfig.json, dashboard types.d.ts) are already on main, so do not merge this red stale branch.

@github-actions

Copy link
Copy Markdown
Contributor

🚫 Merge Blocked

This PR has unresolved blocker items that must be addressed before merging.

Review the task summary above and:

  1. Address all items marked with 🚨 BLOCKER
  2. Check off completed tasks
  3. Or add ignore-task-checks label to bypass (not recommended)

The has-blockers label will be automatically removed when blockers are resolved.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Auto-Merge Enabled

This PR has been configured for automatic merging. It will be merged automatically when:

  • ✅ All required status checks pass
  • ✅ Required approvals are obtained
  • ✅ No merge conflicts exist

To disable auto-merge, add the needs-review label or [skip-auto-merge] to the title.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🤖 Auto-Merge Enabled

This PR has been configured for automatic merging. It will be merged automatically when:

  • ✅ All required status checks pass
  • ✅ Required approvals are obtained
  • ✅ No merge conflicts exist

To disable auto-merge, add the needs-review label or [skip-auto-merge] to the title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Configuration changes dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant