Skip to content

fix(crux): clear crux type errors and make the crux typecheck blocking - #4993

Merged
OAGr merged 1 commit into
mainfrom
claude/cleanup-crux-types
Sep 26, 2026
Merged

OAGr merged 1 commit into
mainfrom
claude/cleanup-crux-types

Conversation

@OAGr

@OAGr OAGr commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

The crux typecheck has been advisory with 17 real errors. Its "baseline" file (crux/validate/crux-tsc-baseline.txt, bumped ~50 times) has not been read by anything since QUA-524 deleted the validator that used it. This PR fixes all 17 errors and makes the typecheck-crux gate step blocking (QUA-636).

  • 16 type-only fixes:
    • Add 4 missing @wiki-server/*-route path aliases to crux/tsconfig.json (copied from apps/web/tsconfig.json).
    • Add crux/next-fetch.d.ts for Next's fetch(…, { next }) option.
    • Type exec options in crux/lib/aiid/fetch.ts.
    • Remove an always-true error !== 'not_found' comparison in crux/commands/agents.ts.
    • Test annotations in mutex.test.ts and lifecycle.test.ts.
  • One real bug: ENTITY_REF_FK_MAP in crux/commands/tb-importers/propose-client.ts had no entry for publication or organization-fact. The semantic-scholar, openalex, crossref and wikidata T1 importers emit those, so buildProposeRequest crashed with "is not iterable". The server's /api/enrichment/propose does not accept those record types at all (SUPPORTED_RECORD_TYPES = grants, personnel, funding-rounds, benchmark-results), so guessing an FK mapping would only move the failure. buildProposeRequest now refuses them with a clear error naming the supported types. New tests cover both types and a supported one.
  • Deletes the dead baseline file, drops advisory: true from typecheck-crux, and removes the "known baseline" exception from error-handling.md and validation-gate-system.md.

Verified: tsc --noEmit -p crux/tsconfig.json reports 0 errors; crux/commands/tb-importers tests 351/351; pre-push gate passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WXiHX1a9DEuvwydgTP43ZE


Generated by Claude Code

- Delete crux-tsc-baseline.txt (unread since QUA-524).
- Type-only fixes for 16 errors (missing path aliases, Next fetch
  options, exec options, test annotations).
- propose-client: publication and organization-fact are not accepted by
  /api/enrichment/propose; refuse them with a clear error instead of
  crashing on the FK map (semantic-scholar, openalex, crossref and
  wikidata T1 proposals hit this).
- typecheck-crux is no longer advisory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WXiHX1a9DEuvwydgTP43ZE
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Protected paths modified

This PR modifies files that affect agent behavior, CI, or validation rules.
A human must review these changes and add the gate:rules-ok label to unblock merge.

Modified protected files:

  • .claude/rules/error-handling.md
  • crux/commands/agents.ts
  • crux/commands/tb-importers/__tests__/propose-client.test.ts
  • crux/commands/tb-importers/propose-client.ts
  • crux/validate/crux-tsc-baseline.txt
  • crux/validate/validate-gate.ts

Status: gate:rules-ok label is present. This check will pass.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 45 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: aa7a8f11-c5f7-467c-bfb2-ced0aec4eaa8

📥 Commits

Reviewing files that changed from the base of the PR and between f65653a and 4e34b88.

📒 Files selected for processing (12)
  • .claude/rules/error-handling.md
  • crux/commands/agents.ts
  • crux/commands/tb-importers/__tests__/propose-client.test.ts
  • crux/commands/tb-importers/propose-client.ts
  • crux/lib/aiid/fetch.ts
  • crux/lib/improve-entity/mutex.test.ts
  • crux/lib/pipeline-runs/lifecycle.test.ts
  • crux/next-fetch.d.ts
  • crux/tsconfig.json
  • crux/validate/crux-tsc-baseline.txt
  • crux/validate/validate-gate.ts
  • docs/agent-rules/validation-gate-system.md

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.

OAGr commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Protected Paths Check is red only because this PR touches protected files (crux/validate/validate-gate.ts, .claude/rules/error-handling.md, the baseline file, propose-client.ts). It's the repo's human-review gate, not a code failure: a maintainer needs to review and add gate:rules-ok. No code change will clear it, and I'm not adding the label myself.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Test Coverage Report

Workspace Lines Branches Functions Statements
wiki-server 56.2% 41.0% 57.8% 55.1%
web 13.2% 11.5% 8.5% 13.3%
discord-bot 39.1% 30.3% 43.6% 38.2%
crux 41.4% 38.7% 44.6% 41.3%
Total 36.6% 29.9% 32.1% 36.2%

Coverage is advisory only — no thresholds enforced. Generated by vitest --coverage.

@OAGr OAGr added the gate:rules-ok Human override for rules gate label Sep 26, 2026 — with Claude
@OAGr
OAGr merged commit 758573b into main Sep 26, 2026
40 of 41 checks passed
@OAGr
OAGr deleted the claude/cleanup-crux-types branch September 26, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gate:rules-ok Human override for rules gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants