fix: create missing metrics.jl, fix README, rate limiter, and Ada parser - #1
Conversation
- 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
There was a problem hiding this comment.
💡 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".
| history_end = max(1, length(turns) - 1) | ||
| history = turns[history_start:history_end] |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
engine/src/metrics.jl(P0): The engine module could not load because this file was missing despite beinginclude()d inJeffEngine.jl:29. Implementscompute_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 inruntests.jl.thejeffparadox_README.md(P1): The placeholder README referencednpm install,pip install, andpython main.py— none of which apply to this Julia/Hugo/Ada project. Replaced with accurate installation and usage instructions matchingREADME.adoc.llm_client.jl(P1): Token-based rate limiting was stubbed out (# simplified here; true). Now properly tracks and enforcestokens_per_minutelimits alongside request count limits, and correctly synchronizes cleanup of bothrequest_timesandtoken_countsvectors.game_state.adb(P2): Added line trimming, YAML comment skipping, key-at-start-of-line matching (prevents substring false matches), and quoted string handling forcurrent_nodevalues.Test plan
engine/src/metrics.jlloads correctly:cd engine && julia --project=. -e 'using JeffEngine; println("OK")'cd engine && julia --project=. test/runtests.jl— metrics tests should now passcd tui && alr buildhttps://claude.ai/code/session_01FdPFGKmDfdZYBgi2jGGoAv