Skip to content

fix: create missing metrics.jl, fix README, rate limiter, and Ada parser - #1

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/analyze-repo-improvements-LntSD
Apr 9, 2026
Merged

fix: create missing metrics.jl, fix README, rate limiter, and Ada parser#1
hyperpolymath merged 1 commit into
mainfrom
claude/analyze-repo-improvements-LntSD

Conversation

@JoshuaJewell

Copy link
Copy Markdown
Owner

Summary

  • Create engine/src/metrics.jl (P0): The engine module could not load because this file was missing despite being include()d in JeffEngine.jl:29. Implements compute_metrics, MetricsSnapshot, metrics_summary, and supporting functions (vocabulary diversity, self/other reference rates, coherence score, convergence index, novel n-gram counting). All functions match the test expectations in runtests.jl.
  • Rewrite thejeffparadox_README.md (P1): The placeholder README referenced npm install, pip install, and python main.py — none of which apply to this Julia/Hugo/Ada project. Replaced with accurate installation and usage instructions matching README.adoc.
  • Fix rate limiting in llm_client.jl (P1): Token-based rate limiting was stubbed out (# simplified here; true). Now properly tracks and enforces tokens_per_minute limits alongside request count limits, and correctly synchronizes cleanup of both request_times and token_counts vectors.
  • Improve Ada YAML parsing in game_state.adb (P2): Added line trimming, YAML comment skipping, key-at-start-of-line matching (prevents substring false matches), and quoted string handling for current_node values.

Test plan

  • Verify engine/src/metrics.jl loads correctly: cd engine && julia --project=. -e 'using JeffEngine; println("OK")'
  • Run Julia test suite: cd engine && julia --project=. test/runtests.jl — metrics tests should now pass
  • Verify Ada TUI builds with updated parser: cd tui && alr build
  • Confirm README accurately reflects project setup instructions

https://claude.ai/code/session_01FdPFGKmDfdZYBgi2jGGoAv

- Create engine/src/metrics.jl: implements compute_metrics, MetricsSnapshot,
  metrics_summary, and supporting functions (vocabulary diversity, reference
  rates, coherence, convergence, novel n-grams). This was a critical missing
  file that prevented the JeffEngine module from loading.
- Rewrite thejeffparadox_README.md: replace incorrect npm/pip placeholder
  with actual Julia/Hugo/Ada instructions matching the real project.
- Fix rate limiting in llm_client.jl: implement token-based rate limiting
  that was previously stubbed out, and properly synchronize cleanup of
  request_times and token_counts vectors.
- Improve Ada YAML parsing in game_state.adb: add line trimming, comment
  skipping, key-at-start-of-line matching, and quoted string handling for
  current_node values.

https://claude.ai/code/session_01FdPFGKmDfdZYBgi2jGGoAv
@github-actions github-actions Bot added documentation Docs, prose, diagrams, READMEs, ADRs engine labels Apr 9, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4471a8d3c

ℹ️ 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".

Comment thread engine/src/metrics.jl
Comment on lines +235 to +236
history_end = max(1, length(turns) - 1)
history = turns[history_start:history_end]

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 Badge Exclude current turn from novelty history window

The history slice includes the current turn when length(turns) == 1 because history_end is forced to 1, so all current n-grams are treated as already seen and compute_novel_ngrams returns 0 even when the first turn contains valid 3–5-grams. This undercounts novelty at experiment start and skews the metric used for emergence tracking.

Useful? React with 👍 / 👎.

@hyperpolymath
hyperpolymath merged commit 25200a0 into main Apr 9, 2026
19 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Docs, prose, diagrams, READMEs, ADRs engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants