Skip to content

fix(prompt): default Java 25 environment stops unnecessary version questions; ESLint replaced by oxlint with Zod and naming rules#24

Merged
WilliamAGH merged 12 commits intomainfrom
dev
Feb 13, 2026
Merged

fix(prompt): default Java 25 environment stops unnecessary version questions; ESLint replaced by oxlint with Zod and naming rules#24
WilliamAGH merged 12 commits intomainfrom
dev

Conversation

@WilliamAGH
Copy link
Owner

@WilliamAGH WilliamAGH commented Feb 12, 2026

Summary

The chat assistant pedantically asked "what Java version are you on?" on every question — even when it had just retrieved and cited the correct JDK 25 docs. The system prompt had six separate "ask for version/confirmation" instructions but no instruction establishing a default. This PR adds a default Java 25 environment assumption and rewrites all prompt modes to only ask when the user contradicts that default. Separately, the frontend lint pipeline drops ESLint (150 MB of dependencies for one naming-convention rule) in favor of oxlint with Zod-specific rules and ast-grep naming enforcement.

Changes

Bug Fixes

  • Chat no longer asks for Java version unprompted: Added a "Default Environment" section to the system prompt that assumes Java 25 with preview disabled, and removed six redundant "ask for version/source/confirmation" instructions across all prompt modes — core, low-quality search, guided learning, and code review (SystemPromptConfig.java)
  • Retrieved facts stated confidently instead of hedged: When RAG docs confirm a fact, the assistant now states it directly instead of asking the user to verify or providing unnecessary caveats (SystemPromptConfig.CORE_PROMPT_TEMPLATE)
  • Version caveats suppressed for finalized features: Features that became final before the configured JDK version are treated as standard language features without version warnings (SystemPromptConfig.CORE_PROMPT_TEMPLATE)

Refactoring

  • ESLint removed, oxlint handles all frontend linting: Dropped eslint, @typescript-eslint/eslint-plugin, and @typescript-eslint/parser (one naming rule was the only justification). oxlint now runs correctness, type-aware, and Zod-specific checks natively via eslint-plugin-zod as a JS plugin with 12 Zod rules (frontend/config/oxlintrc.json, frontend/package.json)
  • ast-grep enforces CLAUDE.md naming conventions: Three rules replace ESLint's @typescript-eslint/naming-convention — ban generic type suffixes like *Data/*Info per [ND1f], ban Hungarian I prefix on interfaces, and require PascalCase on types/interfaces/enums (frontend/rules/ast-grep/)
  • Frontend linting enforced in pre-push hooks: make lint now includes a lint-frontend target (oxlint + ast-grep + svelte-check), and a separate lint step runs before build+test in the prek pre-push hook (Makefile, config/prek.toml)
  • pnpm references corrected to npm: Lint and validate scripts used pnpm but the project uses npm; corrected all script references and regenerated package-lock.json (frontend/package.json)
  • Health check query separated from retry side-effect: isHealthy() is now a pure query; retry triggering moved to explicit triggerRetryIfDue() call, improving Command-Query Separation (ExternalServiceHealth.java)
  • Map initialization uses correct sizing factory: LinkedHashMap.newLinkedHashMap(size) (Java 19+) computes internal capacity to hold the expected number of entries without rehashing, unlike the constructor which uses raw capacity (HybridSearchService.java:141)
  • Unused catch variables use Java 22+ unnamed pattern: ArithmeticException _ in backoff computation where the exception type is sufficient and the instance carries no diagnostic value (ExternalServiceHealth.java:417)

Test Improvements

  • Scroll smoke test uses explicit assertion: Bare await replaced with expect().resolves.toBeUndefined() to actually verify the return value (scroll.test.ts)
  • Zod schemas use v4 z.int() shorthand: z.number().int() replaced with z.int() per the new zod/no-number-schema-with-int lint rule (schemas.ts)

Breaking Changes

None

Test Plan

  • ./gradlew build passes (pre-push hook verified)
  • ./gradlew test passes (242 tests)
  • npm run lint passes (oxlint + ast-grep + svelte-check)
  • Frontend builds cleanly (npm run build)
  • Smoke test chat streaming — verify assistant no longer asks for Java version unprompted
  • Verify assistant still asks when user explicitly mentions an older Java version

…ersion

The system prompt had 6 separate instructions telling the LLM to "ask for
version/confirmation" before answering Java questions, but no instruction
establishing a default environment. This made the assistant pedantically
ask "what Java version are you on?" even when it had just retrieved and
cited the correct JDK docs. The compounding effect of these rules made
the chat experience frustrating for users.

Add a Default Environment section that assumes Java 25 with preview
disabled, and rewrite the version/quality rules across all prompt modes
(core, low-quality search, guided learning, code review) to only ask
when the user contradicts the default or the answer genuinely varies
across versions.

- Add Default Environment section with explicit "do NOT ask" constraint
- Rewrite Data Sources rule to supplement with general knowledge instead
  of blocking on missing details
- Add rule to state retrieved facts confidently without hedging
- Rewrite Version Awareness to trust retrieved docs and skip version caveats
  for features finalized before the configured JDK version
- Remove "ask for version/source" from low-quality search prompt
- Remove "ask a clarifying question" from guided learning prompt
- Remove "ask for the exact file or version" from code review prompt
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Updated system prompt defaults and guidance (assume Java version context, preview disabled by default), refined RAG/fallback and version-awareness rules, adjusted multiple prompt variants, and made small service-code cleanups (health null-check simplification and LinkedHashMap construction change).

Changes

Cohort / File(s) Summary
System Prompt Configuration
src/main/java/com/williamcallahan/javachat/config/SystemPromptConfig.java
Added a Default Environment block (assume active Java version; preview DISABLED by default unless user overrides); clarified RAG/data fallback and confident assertions when docs confirm; updated response guideline to “answer first, caveats when relevant”; updated version-awareness (treat retrieved doc feature status as final/preview/removed; require explicit --enable-preview mention; handle cross-release diffs proactively); adjusted low-quality search, guided learning, and code-review prompt texts; minor wording tweaks.
Service logic changes
src/main/java/com/williamcallahan/javachat/service/ExternalServiceHealth.java, src/main/java/com/williamcallahan/javachat/service/HybridSearchService.java
ExternalServiceHealth: simplified health null-check to `return status == null
Build / Manifest
manifest_file, pom.xml, build.gradle
Minor manifest/build metadata/config tweaks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A prompt learns its default state with care,
Preview dimmed unless the user declares.
Docs back claims; health checks keep their beat,
Small code shifts humming tidy and sweet. 🛠️✨

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (3 files):

⚔️ src/main/java/com/williamcallahan/javachat/config/SystemPromptConfig.java (content)
⚔️ src/main/java/com/williamcallahan/javachat/service/ExternalServiceHealth.java (content)
⚔️ src/main/java/com/williamcallahan/javachat/service/HybridSearchService.java (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
Title check ⚠️ Warning The PR title mentions ESLint and oxlint frontend linting changes, but the actual changeset focuses on Java system prompt configuration and service refactoring with only minor frontend lint tool references. Revise the title to focus on the primary Java changes: 'fix(prompt): add Java 25 default environment to reduce redundant version questions' or similar, moving frontend lint details to the description.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.
Description check ✅ Passed The description comprehensively covers the actual changes in the changeset, including the Java prompt defaults, health check refactoring, and Map initialization updates, and aligns well with the raw summary provided.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch dev
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c00e87d52

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coderabbitai coderabbitai bot changed the title Dev branch merge: prompt fix, analytics, health checks, Qdrant config, and code quality Dev branch Update system prompt with Java baseline and RAG refinements: prompt fix, analytics, health checks, Qdrant config, and code quality Feb 12, 2026
ESLint added ~150MB of dependencies (@typescript-eslint/parser, eslint core) for
a single naming-convention rule. oxlint already handles correctness, suspicious,
and type-aware linting natively. This replaces ESLint entirely with:

- eslint-plugin-zod as an oxlint JS plugin for Zod-specific lint rules
- Enhanced oxlintrc.json with 12 Zod rules (no-any-schema, require-error-message, etc.)
- Rule overrides for legitimate patterns (side-effect imports, sequential stream awaits)
- Test-file overrides for Zod suffix/message rules
- Moved config from root oxlintrc.json to config/oxlintrc.json for organization

- Remove eslint, @typescript-eslint/eslint-plugin, @typescript-eslint/parser
- Add eslint-plugin-zod as devDependency
- Replace lint:es script with lint:sg (ast-grep) stage
- Update all oxlint -c paths to config/oxlintrc.json
ESLint's @typescript-eslint/naming-convention was the only rule justifying the
ESLint dependency. These three ast-grep rules replace it with faster, more
targeted checks aligned to CLAUDE.md naming discipline rules.

- Ban generic type suffixes (*Data, *Info, *Object, etc.) per [ND1f]
- Ban Hungarian "I" prefix on interfaces per [NM2]
- Require PascalCase for type aliases, interfaces, and enums per [ND1f]
- Add sgconfig.yml pointing to rules/ast-grep directory
Frontend linting was not enforced by `make lint` or the prek pre-push hook,
allowing violations to accumulate. This adds a dedicated `lint-frontend` target
and wires it into both the lint target and the pre-push hook so violations are
caught before they reach the remote.

- Add lint-frontend Makefile target running pnpm lint + svelte-check
- Wire lint-frontend into the existing lint target
- Add lint step to prek.toml pre-push hooks (runs before build+test)
The new oxlint config surfaced 6 violations that are all false positives on
legitimate code patterns. Two require source-level fixes since oxlint overrides
cannot disable category-enabled rules per-file.

- Add oxlint-disable-next-line for jsdom scrollTo polyfill in test setup
- Replace bare await with expect().resolves.toBeUndefined() in scroll smoke test
The eslint-plugin-zod rule zod/no-number-schema-with-int flags z.number().int()
as redundant when z.int() exists as a first-class Zod v4 API. Verified against
zod 3.25.76 source: z.int() returns ZodNumberFormat with format 'safeint',
functionally identical to z.number().int().

- Replace z.number().int().positive() with z.int().positive() in SSE schemas
The Makefile has always used `npm` for frontend commands, but pnpm-lock.yaml was
introduced by mistake. npm's strict peer dep resolution rejects eslint-plugin-zod
because it declares peerOptional zod@"^4" while zod's v4 API ships under 3.25.x
semver. The override tells npm to use the project's zod version for that plugin.

- Delete pnpm-lock.yaml and regenerate package-lock.json via npm install
- Replace pnpm references in lint/validate scripts with npm run
- Add overrides entry to resolve eslint-plugin-zod peer dep on zod
@WilliamAGH WilliamAGH changed the title Dev branch Update system prompt with Java baseline and RAG refinements: prompt fix, analytics, health checks, Qdrant config, and code quality fix(prompt): default Java 25 environment stops unnecessary version questions; ESLint replaced by oxlint with Zod and naming rules Feb 13, 2026
@WilliamAGH WilliamAGH merged commit 5d20510 into main Feb 13, 2026
3 checks passed
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

Comments