Skip to content

33 refactor corpus #36

Open
dpom wants to merge 6 commits into
masterfrom
33-refactor-corpus
Open

33 refactor corpus #36
dpom wants to merge 6 commits into
masterfrom
33-refactor-corpus

Conversation

@dpom
Copy link
Copy Markdown
Owner

@dpom dpom commented Apr 25, 2026

  • refactor corpus structure
  • add new elements in corpus
  • add save-glyphs cli action
  • add renormalize-corpus cli action
  • refactor show module to display images in emacs

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 2026

📝 Walkthrough

Walkthrough

Refactors the project to use directory-based corpus processing, replaces interactive Matplotlib display with an Emacs-driven image pipeline, adds ~120+ EDN corpus data files, updates reference-building to walk corpus directories, and adjusts specs, utilities, and translator modules accordingly.

Changes

Cohort / File(s) Summary
Git / Misc
/.gitignore, template.txt
Added /Steno.org to .gitignore and added template.txt.
Corpus data (many files)
resources/corpus/*/.../*.edn (≈120+ new files)
Large set of new EDN corpus entries (templates & yoga samples) added across many subdirectories; each file is a single-map EDN with :fileimage, position metadata, and :lineseq.
Reference files
resources/diff-references.edn, resources/freq-references.edn
Regenerated reference mappings: updated per-letter parameters, new reference sequences, changed letter sets (includes "ţ"), and adjusted length/match thresholds.
Corpus module (added/removed)
src/steno/corpus.lpy, src/steno/corpus.clj
Added src/steno/corpus.lpy (corpus extraction, glyph->wsign conversion, per-lsign EDN writes, corpus walkers); removed the old Clojure src/steno/corpus.clj.
Core CLI / flow
src/steno/core.lpy
Refactored actions: action-translate, action-make-corpus, action-make-references updated to operate on corpus directories and per-lsign files; added default-* directory constants and new actions save-glyphs and renormalize-corpus; removed word-image extract/save helpers.
Display pipeline
src/steno/show.lpy
Replaced Matplotlib interactive show with Emacs image pipeline: added figure-to-bytes and display-image-stream; updated display functions to emit PNG bytes and call emacsclient.
Translator & translators
src/steno/translator.lpy, src/steno/translators/diff.lpy, src/steno/translators/freq.lpy
Switched translators to corpus-directory-driven reference building; letter sets changed (vectors→sets); added type-0?/type-1?; build-references now walks directories and uses utl/load-edn.
Specs
src/steno/spec.lpy
Changed CNUM constraint from signed 8-bit to nat-int? with < 256 (affects downstream types).
Utilities
src/steno/utils.lpy
Added docstrings to load-edn/save-edn; save-edn now writes a trailing newline after EDN serialization.
Misc code adjustments
src/steno/converter.lpy, src/steno/extractor.lpy, src/steno/imageprocessor.lpy
Made normalize2-lsign public; reorganized requires; removed utl/start-proc wrapper in comment blocks; minor comment/format edits.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant CLI
    participant Corpus as "steno.corpus"
    participant Translator as "translators"
    participant Utils as "steno.utils / FS"
    participant Emacs as "emacsclient"
    CLI->>Corpus: extract glyphs / walk corpus
    Corpus->>Corpus: convert glyph -> wsign / emit per-lsign EDN (save via Utils)
    CLI->>Translator: request build-references / translate (pointed to corpus-dir)
    Translator->>Utils: load EDN files from corpus-dir
    Translator->>CLI: stream translated text output
    CLI->>Emacs: request image display (PNG bytes)
    Emacs-->>CLI: render image
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰
Hopped through folders, lineseqs in paw,
EDN seeds scattered across the repo's floor,
Emacs sips PNGs while matsleep is no more,
Glyphs turned to files, references reborn—
A rabbit's small trumpet for the corpus spawned! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title '33 refactor corpus' is vague and generic, using non-descriptive terms that don't clearly convey the scope or nature of the changes in the changeset. Provide a more descriptive title that explains the main refactor (e.g., 'Refactor corpus processing to write per-lsign EDN files' or 'Update corpus structure and translator implementations').
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description check ✅ Passed The PR description provides a bulleted list of changes that directly relates to the changeset modifications across corpus files, CLI actions, and the show module.

✏️ 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 33-refactor-corpus

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

@dpom dpom self-assigned this Apr 25, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (4)
resources/corpus/o/yoga1-10-08-6.edn (1)

1-1: Consider adding a trailing newline.

The file is missing a trailing newline, which is a POSIX text file convention and often flagged by linters/formatters.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@resources/corpus/o/yoga1-10-08-6.edn` at line 1, This EDN file ends without a
trailing newline; open the record that starts with the map token "{:fileimage
\"tmp/yoga1.png\" ...}" (the top-level EDN map) and append a single newline
character at the end of the file so the file ends with a trailing newline (POSIX
text file convention).
src/steno/corpus.lpy (1)

71-80: Minor documentation typos.

The docstring has a couple of typos: "side-efect" should be "side-effect" and "director" should be "directory".

✏️ Proposed fix
 (defn walk-corpus
-  "Traverse the directories in CORPUS-DIR and apply the PROCESS-FN function to FILTERed ones.
-  The function is side-efect free and accepts the director as an argument.
+  "Traverse the directories in CORPUS-DIR and apply the PROCESS-FN function to FILTERed ones.
+  The function is side-effect free and accepts the directory as an argument.
   Returns a lazy collection."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/steno/corpus.lpy` around lines 71 - 80, Update the docstring of the
function walk-corpus to correct the typos: change "side-efect" to "side-effect"
and "director" to "directory", keeping the rest of the description intact
(mentioning CORPUS-DIR, PROCESS-FN, FILTERed, and that it returns a lazy
collection).
src/steno/translators/freq.lpy (1)

134-164: Consider updating or removing stale comment block.

The comment block references the old API (tra/load-edn, passing corpus object directly to tra/build-references), which no longer matches the refactored implementation that uses utl/load-edn and directory-based corpus walking.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/steno/translators/freq.lpy` around lines 134 - 164, The large commented
example in src/steno/translators/freq.lpy is stale: it shows the old API
(tra/load-edn and passing a corpus object into tra/build-references) but the
codebase now uses utl/load-edn and a directory-based corpus walker; update or
remove this block. Locate the comment block containing calls like tra/load-edn,
tra/build-references, tra/translate and either rewrite the examples to use
utl/load-edn and the current directory-walking helpers and the new
build-references signature, or delete the entire example comment to avoid
confusion.
src/steno/translators/diff.lpy (1)

171-214: Consider updating or removing stale comment block.

The comment block references tra/load-edn and tra/save-edn which have been removed from translator.lpy. These utilities are now in steno.utils.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/steno/translators/diff.lpy` around lines 171 - 214, The large commented
example in diff.lpy is stale because it calls tra/load-edn and tra/save-edn
which were removed from translator.lpy; either delete the entire comment block
or update it to use the new utilities (steno.utils/load-edn and
steno.utils/save-edn) and any new API names, and adjust the example to call the
current translate helpers (e.g., translate-numseq, tra/translate) as needed;
locate the block by the long (comment ... ) section and replace or remove
references to tra/load-edn and tra/save-edn (and any other changed symbols) so
the example reflects the current steno.utils APIs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/steno/core.lpy`:
- Around line 64-79: The routines that write to user-specified output files
(notably the action-translate flow where you open outfile with (bio/writer
outfile) and the similar action-make-references flow) assume parent directories
exist; update both to ensure the destination directory is created before opening
the writer: compute the parent directory of outfile, create it (recursively) if
missing, then proceed to create the writer and write output. Locate the places
referencing outfile and the writer creation (the block with (with-open [of
(bio/writer outfile)] ...] and the analogous block in action-make-references)
and add a directory-creation step before opening the writer so writes cannot
fail on fresh paths.
- Around line 95-101: The binding for text uses (get (tra/translate-lsign ctx
translators lsign) :text "@") but tra/translate-lsign always includes the :text
key (sometimes as nil), so the default "@" is never used; update the text
extraction to coalesce nil to "@" (e.g. retrieve the translation map into a
local like translated and set text to (or (:text translated) "@") or use an
explicit nil check) so lsign-dir = (bio/path outdir text) always receives "@"
for untranslated glyphs; adjust references in this let block (lsign,
translated/translation map, text, lsign-dir) accordingly.

In `@src/steno/corpus.lpy`:
- Around line 13-25: Rename the function extract-lsign-from-wsing! to
extract-lsign-from-wsign! to fix the typo: update the defn name and any
references/call sites that invoke extract-lsign-from-wsing! to the new name
extract-lsign-from-wsign! (ensure parameter list [imagefile outdir row column
wsign] and internal usage of wsign/ws remain unchanged); search the repo for
extract-lsign-from-wsing! and replace all occurrences so callers (and any public
API/exports) use extract-lsign-from-wsign! consistently.

In `@src/steno/show.lpy`:
- Around line 17-25: Temporary PNG files created by tf/NamedTemporaryFile with
:delete false (tmp-path) are never removed after calling sp/run to invoke
emacsclient, leaking one file per show-* call; fix by ensuring tmp-path is
unlinked in a finally/ensure block after the (.close tmp) and sp/run
["emacsclient" ...] call so the file is removed regardless of success or
exceptions—use the project’s file-unlink utility (or fs/remove/io-file delete)
to delete tmp-path and catch/log any unlink errors so cleanup never silently
fails.
- Around line 75-77: The code calls (plt/subplots num-rows num-cols ...) even
when glyphs is empty or all rows empty; add a guard before creating the subplot
grid to handle the "no glyphs to show" case: compute num-rows and num-cols as
currently done, then if (or (zero? num-rows) (zero? num-cols)) return/exit early
(no-op or a simple message) instead of invoking plt/subplots; update the logic
around the local bindings that define glyphs, num-rows, num-cols and the call to
plt/subplots so functions like plt/subplots are only called when both num-rows
and num-cols are > 0.

---

Nitpick comments:
In `@resources/corpus/o/yoga1-10-08-6.edn`:
- Line 1: This EDN file ends without a trailing newline; open the record that
starts with the map token "{:fileimage \"tmp/yoga1.png\" ...}" (the top-level
EDN map) and append a single newline character at the end of the file so the
file ends with a trailing newline (POSIX text file convention).

In `@src/steno/corpus.lpy`:
- Around line 71-80: Update the docstring of the function walk-corpus to correct
the typos: change "side-efect" to "side-effect" and "director" to "directory",
keeping the rest of the description intact (mentioning CORPUS-DIR, PROCESS-FN,
FILTERed, and that it returns a lazy collection).

In `@src/steno/translators/diff.lpy`:
- Around line 171-214: The large commented example in diff.lpy is stale because
it calls tra/load-edn and tra/save-edn which were removed from translator.lpy;
either delete the entire comment block or update it to use the new utilities
(steno.utils/load-edn and steno.utils/save-edn) and any new API names, and
adjust the example to call the current translate helpers (e.g.,
translate-numseq, tra/translate) as needed; locate the block by the long
(comment ... ) section and replace or remove references to tra/load-edn and
tra/save-edn (and any other changed symbols) so the example reflects the current
steno.utils APIs.

In `@src/steno/translators/freq.lpy`:
- Around line 134-164: The large commented example in
src/steno/translators/freq.lpy is stale: it shows the old API (tra/load-edn and
passing a corpus object into tra/build-references) but the codebase now uses
utl/load-edn and a directory-based corpus walker; update or remove this block.
Locate the comment block containing calls like tra/load-edn,
tra/build-references, tra/translate and either rewrite the examples to use
utl/load-edn and the current directory-walking helpers and the new
build-references signature, or delete the entire example comment to avoid
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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 97e3f32a-5786-484c-abc0-2e4c59a66b2f

📥 Commits

Reviewing files that changed from the base of the PR and between 715256a and 14ca183.

⛔ Files ignored due to path filters (2)
  • Notebook.org is excluded by !Notebook.org, !*.org
  • README.org is excluded by !*.org
📒 Files selected for processing (142)
  • .gitignore
  • resources/corpus/a/template-01-04-1.edn
  • resources/corpus/a/template-02-00-0.edn
  • resources/corpus/a/template-02-01-1.edn
  • resources/corpus/a/template-03-00-1.edn
  • resources/corpus/a/template-04-03-1.edn
  • resources/corpus/a/template-05-01-0.edn
  • resources/corpus/a/yoga1-00-14-4.edn
  • resources/corpus/a/yoga1-00-15-1.edn
  • resources/corpus/a/yoga1-03-03-1.edn
  • resources/corpus/a/yoga1-04-01-0.edn
  • resources/corpus/a/yoga1-09-27-1.edn
  • resources/corpus/a/yoga1-09-29-3.edn
  • resources/corpus/a/yoga1-13-02-0.edn
  • resources/corpus/a/yoga1-15-00-6.edn
  • resources/corpus/a/yoga1_12-16-06-0.edn
  • resources/corpus/b/yoga1-04-01-1.edn
  • resources/corpus/b/yoga1-17-08-1.edn
  • resources/corpus/c/template-00-02-0.edn
  • resources/corpus/c/template-04-04-3.edn
  • resources/corpus/c/yoga1-09-12-0.edn
  • resources/corpus/c/yoga1-09-18-6.edn
  • resources/corpus/c/yoga1-13-02-2.edn
  • resources/corpus/c/yoga1-15-01-0.edn
  • resources/corpus/c/yoga1-17-05-1.edn
  • resources/corpus/c/yoga1-19-00-3.edn
  • resources/corpus/c/yoga1_12-03-02-1.edn
  • resources/corpus/c/yoga1_12-10-07-1.edn
  • resources/corpus/c/yoga1_12-10-36-0.edn
  • resources/corpus/c/yoga1_12-11-02-0.edn
  • resources/corpus/c/yoga1_12-16-00-0.edn
  • resources/corpus/d/yoga1-03-01-5.edn
  • resources/corpus/d/yoga1-03-01-8.edn
  • resources/corpus/d/yoga1-04-01-2.edn
  • resources/corpus/d/yoga1-05-02-7.edn
  • resources/corpus/d/yoga1-09-27-0.edn
  • resources/corpus/d/yoga1-16-01-1.edn
  • resources/corpus/d/yoga1-16-08-2.edn
  • resources/corpus/d/yoga1-17-05-4.edn
  • resources/corpus/d/yoga1-17-09-6.edn
  • resources/corpus/d/yoga1-17-10-0.edn
  • resources/corpus/d/yoga1_12-01-03-1.edn
  • resources/corpus/e/template-01-06-0.edn
  • resources/corpus/f/template-00-03-0.edn
  • resources/corpus/g/yoga1-11-02-2.edn
  • resources/corpus/g/yoga1_12-03-07-0.edn
  • resources/corpus/g/yoga1_12-07-00-2.edn
  • resources/corpus/i/template-01-07-0.edn
  • resources/corpus/j/template-01-02-0.edn
  • resources/corpus/j/template-04-00-0.edn
  • resources/corpus/j/template-04-04-0.edn
  • resources/corpus/l/yoga1-16-08-3.edn
  • resources/corpus/m/template-01-00-0.edn
  • resources/corpus/m/template-04-01-1.edn
  • resources/corpus/m/template-04-02-0.edn
  • resources/corpus/n/template-01-01-0.edn
  • resources/corpus/o/template-01-05-1.edn
  • resources/corpus/o/template-03-02-1.edn
  • resources/corpus/o/template-04-01-0.edn
  • resources/corpus/o/template-04-02-1.edn
  • resources/corpus/o/template-04-04-2.edn
  • resources/corpus/o/yoga1-00-03-2.edn
  • resources/corpus/o/yoga1-05-02-0.edn
  • resources/corpus/o/yoga1-09-17-3.edn
  • resources/corpus/o/yoga1-09-35-1.edn
  • resources/corpus/o/yoga1-09-38-0.edn
  • resources/corpus/o/yoga1-10-06-2.edn
  • resources/corpus/o/yoga1-10-07-7.edn
  • resources/corpus/o/yoga1-10-08-6.edn
  • resources/corpus/o/yoga1-10-09-0.edn
  • resources/corpus/o/yoga1-11-01-1.edn
  • resources/corpus/o/yoga1-13-02-3.edn
  • resources/corpus/o/yoga1-15-05-0.edn
  • resources/corpus/o/yoga1-16-01-0.edn
  • resources/corpus/o/yoga1-16-08-1.edn
  • resources/corpus/o/yoga1-16-12-0.edn
  • resources/corpus/o/yoga1-17-08-0.edn
  • resources/corpus/o/yoga1-17-08-9.edn
  • resources/corpus/o/yoga1-18-02-1.edn
  • resources/corpus/o/yoga1-18-04-0.edn
  • resources/corpus/o/yoga1-21-30-1.edn
  • resources/corpus/o/yoga1-21-61-1.edn
  • resources/corpus/o/yoga1_12-03-00-9.edn
  • resources/corpus/o/yoga1_12-03-04-1.edn
  • resources/corpus/o/yoga1_12-04-01-0.edn
  • resources/corpus/o/yoga1_12-04-01-3.edn
  • resources/corpus/o/yoga1_12-04-03-0.edn
  • resources/corpus/o/yoga1_12-04-05-1.edn
  • resources/corpus/o/yoga1_12-06-11-0.edn
  • resources/corpus/o/yoga1_12-07-00-3.edn
  • resources/corpus/o/yoga1_12-09-01-3.edn
  • resources/corpus/o/yoga1_12-10-02-1.edn
  • resources/corpus/o/yoga1_12-10-32-1.edn
  • resources/corpus/o/yoga1_12-11-03-0.edn
  • resources/corpus/o/yoga1_12-11-13-0.edn
  • resources/corpus/o/yoga1_12-12-06-0.edn
  • resources/corpus/o/yoga1_12-16-03-1.edn
  • resources/corpus/o/yoga1_12-18-03-0.edn
  • resources/corpus/o/yoga1_12-21-04-0.edn
  • resources/corpus/o/yoga1_12-23-01-0.edn
  • resources/corpus/o/yoga1_12-23-02-0.edn
  • resources/corpus/o/yoga1_12-23-03-0.edn
  • resources/corpus/p/template-00-00-0.edn
  • resources/corpus/p/template-02-00-1.edn
  • resources/corpus/p/template-03-00-0.edn
  • resources/corpus/p/template-03-01-0.edn
  • resources/corpus/p/template-03-02-0.edn
  • resources/corpus/r/template-03-02-3.edn
  • resources/corpus/r/yoga1-00-01-0.edn
  • resources/corpus/r/yoga1-17-06-0.edn
  • resources/corpus/r/yoga1-18-02-0.edn
  • resources/corpus/r/yoga1-21-02-1.edn
  • resources/corpus/r/yoga1_12-02-08-1.edn
  • resources/corpus/r/yoga1_12-05-01-0.edn
  • resources/corpus/r/yoga1_12-05-07-3.edn
  • resources/corpus/r/yoga1_12-06-00-0.edn
  • resources/corpus/r/yoga1_12-23-02-3.edn
  • resources/corpus/s/template-01-03-0.edn
  • resources/corpus/s/template-04-02-2.edn
  • resources/corpus/s/template-04-03-0.edn
  • resources/corpus/t/template-00-01-0.edn
  • resources/corpus/t/template-02-01-0.edn
  • resources/corpus/t/template-03-00-2.edn
  • resources/corpus/t/template-03-01-1.edn
  • resources/corpus/t/template-04-03-3.edn
  • resources/corpus/t/yoga1-17-08-2.edn
  • resources/corpus/ţ/template-01-08-0.edn
  • resources/diff-references.edn
  • resources/freq-references.edn
  • src/steno/converter.lpy
  • src/steno/core.lpy
  • src/steno/corpus.clj
  • src/steno/corpus.lpy
  • src/steno/extractor.lpy
  • src/steno/imageprocessor.lpy
  • src/steno/show.lpy
  • src/steno/spec.lpy
  • src/steno/translator.lpy
  • src/steno/translators/diff.lpy
  • src/steno/translators/freq.lpy
  • src/steno/utils.lpy
  • template.txt
💤 Files with no reviewable changes (1)
  • src/steno/corpus.clj

Comment thread src/steno/core.lpy
Comment thread src/steno/core.lpy
Comment thread src/steno/corpus.lpy Outdated
Comment thread src/steno/show.lpy
Comment thread src/steno/show.lpy Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
src/steno/core.lpy (2)

121-123: ⚠️ Potential issue | 🟠 Major

Ensure the references output directory exists.

utl/save-edn writes directly to outfile, so a new -o directory still fails here unless it is created first.

🛠️ Proposed fix
       (let [references (tra/build-references tr config corpus-dir)
             outfile (bio/path outdir (str tr "-references.edn"))]
+        (.mkdir (Path. outdir) ** :parents true :exist_ok true)
         (utl/save-edn outfile references)
         (.info logger "saved in %s" outfile)))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/steno/core.lpy` around lines 121 - 123, The code calls
tra/build-references and then utl/save-edn with outfile but does not ensure the
target directory exists; before calling utl/save-edn, create the output
directory (outdir or the parent directory of outfile) if missing so writing
won't fail. Locate the block using references, outfile, bio/path and add a
directory-creation step (mkdir -p / ensure-parent-dirs) for outdir or outfile's
parent prior to calling utl/save-edn.

65-79: ⚠️ Potential issue | 🟠 Major

Create the parent directory before opening outfile.

A fresh -o path still fails here because bio/writer is opened before the parent directory exists. action-make-corpus already handles this case.

🛠️ Proposed fix
   (let [infile (get config "input")
         outfile (get config "output")
         translators (get config "translators")
         logger (:logger config)]
     (.info logger "Translate %s using %s" infile translators)
+    (when-let [parent (.parent (Path. outfile))]
+      (.mkdir parent ** :parents true :exist_ok true))
     (with-open [of (bio/writer outfile)]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/steno/core.lpy` around lines 65 - 79, The code opens bio/writer on
outfile before ensuring its parent directory exists, causing failures for new -o
paths; before the with-open that invokes (bio/writer outfile) ensure the parent
directory of outfile is created (use the same approach as action-make-corpus:
compute the parent dir from outfile and create it if missing, e.g. mkdirs or an
equivalent I/O util) so that bio/writer can open the file successfully.
🧹 Nitpick comments (1)
src/steno/core.lpy (1)

70-72: Move per-glyph translation logs to DEBUG.

This runs once per glyph, so keeping it at INFO will flood normal CLI output and slow larger images.

🔇 Small tweak
-                   (.info logger "text: %s" text)
+                   (.debug logger "text: %s" text)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/steno/core.lpy` around lines 70 - 72, The per-glyph log currently emitted
at info level inside the anonymous function (f! / fn [row _column {:keys
[wsign]}]) that calls tra/translate-wsign should be lowered to debug to avoid
flooding output; replace the logger .info call ("text: %s" text) with a
debug-level call (e.g., logger.debug) so translate-wsign's per-glyph messages
only appear when debugging.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/steno/core.lpy`:
- Around line 135-150: The renormalization currently lets exceptions from
utl/load-edn or utl/save-edn abort the whole batch; update renormalize-lsigns!
to catch exceptions per file and continue: wrap the load → cnv/normalize2-lsign
→ save pipeline in a try/catch (or try) that on error logs the file path and the
exception and skips to the next file. To access logging, either add a logger
parameter to renormalize-lsigns! (and pass the :logger from
action-renormalize-corpus) or perform the try/catch inside
action-renormalize-corpus when invoking the per-file work; in either case ensure
errors from utl/load-edn and utl/save-edn are caught, logged, and do not rethrow
so the corpus walk completes.

---

Duplicate comments:
In `@src/steno/core.lpy`:
- Around line 121-123: The code calls tra/build-references and then utl/save-edn
with outfile but does not ensure the target directory exists; before calling
utl/save-edn, create the output directory (outdir or the parent directory of
outfile) if missing so writing won't fail. Locate the block using references,
outfile, bio/path and add a directory-creation step (mkdir -p /
ensure-parent-dirs) for outdir or outfile's parent prior to calling
utl/save-edn.
- Around line 65-79: The code opens bio/writer on outfile before ensuring its
parent directory exists, causing failures for new -o paths; before the with-open
that invokes (bio/writer outfile) ensure the parent directory of outfile is
created (use the same approach as action-make-corpus: compute the parent dir
from outfile and create it if missing, e.g. mkdirs or an equivalent I/O util) so
that bio/writer can open the file successfully.

---

Nitpick comments:
In `@src/steno/core.lpy`:
- Around line 70-72: The per-glyph log currently emitted at info level inside
the anonymous function (f! / fn [row _column {:keys [wsign]}]) that calls
tra/translate-wsign should be lowered to debug to avoid flooding output; replace
the logger .info call ("text: %s" text) with a debug-level call (e.g.,
logger.debug) so translate-wsign's per-glyph messages only appear when
debugging.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e732cedd-999b-471e-bda7-02a2179878d7

📥 Commits

Reviewing files that changed from the base of the PR and between 14ca183 and 328482a.

⛔ Files ignored due to path filters (1)
  • Notebook.org is excluded by !Notebook.org, !*.org
📒 Files selected for processing (65)
  • resources/corpus/a/template-01-04-1.edn
  • resources/corpus/a/template-02-00-0.edn
  • resources/corpus/a/template-02-01-1.edn
  • resources/corpus/a/template-03-00-1.edn
  • resources/corpus/a/template-04-03-1.edn
  • resources/corpus/a/template-05-01-0.edn
  • resources/corpus/c/template-00-02-0.edn
  • resources/corpus/c/template-04-04-3.edn
  • resources/corpus/c/yoga1_12-03-06-1.edn
  • resources/corpus/c/yoga1_12-10-02-2.edn
  • resources/corpus/d/yoga1-04-01-2.edn
  • resources/corpus/d/yoga1-16-01-1.edn
  • resources/corpus/d/yoga1-16-08-2.edn
  • resources/corpus/d/yoga1-17-09-6.edn
  • resources/corpus/d/yoga1_12-09-11-4.edn
  • resources/corpus/d/yoga1_12-10-04-0.edn
  • resources/corpus/d/yoga1_12-16-06-1.edn
  • resources/corpus/d/yoga1_12-19-00-2.edn
  • resources/corpus/e/template-01-06-0.edn
  • resources/corpus/f/template-00-03-0.edn
  • resources/corpus/i/template-01-07-0.edn
  • resources/corpus/j/template-01-02-0.edn
  • resources/corpus/j/template-04-00-0.edn
  • resources/corpus/j/template-04-04-0.edn
  • resources/corpus/j/yoga1-17-09-4.edn
  • resources/corpus/l/yoga1-16-08-3.edn
  • resources/corpus/l/yoga1-17-09-3.edn
  • resources/corpus/m/template-01-00-0.edn
  • resources/corpus/m/template-04-01-1.edn
  • resources/corpus/m/template-04-02-0.edn
  • resources/corpus/n/template-01-01-0.edn
  • resources/corpus/n/yoga1_12-10-09-4.edn
  • resources/corpus/o/template-01-05-1.edn
  • resources/corpus/o/template-03-02-1.edn
  • resources/corpus/o/template-04-01-0.edn
  • resources/corpus/o/template-04-02-1.edn
  • resources/corpus/o/template-04-04-2.edn
  • resources/corpus/o/yoga1-16-08-1.edn
  • resources/corpus/o/yoga1_12-03-06-0.edn
  • resources/corpus/p/template-00-00-0.edn
  • resources/corpus/p/template-02-00-1.edn
  • resources/corpus/p/template-03-00-0.edn
  • resources/corpus/p/template-03-01-0.edn
  • resources/corpus/p/template-03-02-0.edn
  • resources/corpus/r/template-03-02-3.edn
  • resources/corpus/r/yoga1_12-08-04-3.edn
  • resources/corpus/r/yoga1_12-09-06-3.edn
  • resources/corpus/r/yoga1_12-16-01-2.edn
  • resources/corpus/s/template-01-03-0.edn
  • resources/corpus/s/template-04-02-2.edn
  • resources/corpus/s/template-04-03-0.edn
  • resources/corpus/t/template-00-01-0.edn
  • resources/corpus/t/template-02-01-0.edn
  • resources/corpus/t/template-03-00-2.edn
  • resources/corpus/t/template-03-01-1.edn
  • resources/corpus/t/template-04-03-3.edn
  • resources/corpus/t/yoga1-17-08-2.edn
  • resources/corpus/t/yoga1-17-09-5.edn
  • resources/corpus/t/yoga1_12-10-02-3.edn
  • resources/corpus/v/yoga1_12-03-06-2.edn
  • resources/corpus/ţ/template-01-08-0.edn
  • src/steno/converter.lpy
  • src/steno/core.lpy
  • src/steno/corpus.lpy
  • src/steno/show.lpy
✅ Files skipped from review due to trivial changes (52)
  • resources/corpus/o/yoga1-16-08-1.edn
  • resources/corpus/i/template-01-07-0.edn
  • resources/corpus/c/template-04-04-3.edn
  • resources/corpus/m/template-01-00-0.edn
  • resources/corpus/j/yoga1-17-09-4.edn
  • resources/corpus/o/template-04-04-2.edn
  • resources/corpus/j/template-04-00-0.edn
  • resources/corpus/r/yoga1_12-16-01-2.edn
  • resources/corpus/f/template-00-03-0.edn
  • resources/corpus/a/template-02-01-1.edn
  • resources/corpus/t/template-02-01-0.edn
  • resources/corpus/s/template-01-03-0.edn
  • resources/corpus/ţ/template-01-08-0.edn
  • resources/corpus/o/template-03-02-1.edn
  • resources/corpus/j/template-01-02-0.edn
  • resources/corpus/o/template-04-02-1.edn
  • resources/corpus/n/template-01-01-0.edn
  • resources/corpus/p/template-03-00-0.edn
  • resources/corpus/d/yoga1_12-19-00-2.edn
  • resources/corpus/a/template-02-00-0.edn
  • resources/corpus/t/yoga1-17-09-5.edn
  • resources/corpus/l/yoga1-16-08-3.edn
  • resources/corpus/c/yoga1_12-03-06-1.edn
  • resources/corpus/d/yoga1_12-09-11-4.edn
  • resources/corpus/o/template-04-01-0.edn
  • resources/corpus/l/yoga1-17-09-3.edn
  • resources/corpus/d/yoga1_12-10-04-0.edn
  • resources/corpus/t/yoga1_12-10-02-3.edn
  • resources/corpus/a/template-04-03-1.edn
  • resources/corpus/t/template-00-01-0.edn
  • resources/corpus/p/template-03-01-0.edn
  • resources/corpus/n/yoga1_12-10-09-4.edn
  • resources/corpus/a/template-03-00-1.edn
  • resources/corpus/s/template-04-03-0.edn
  • resources/corpus/d/yoga1-04-01-2.edn
  • resources/corpus/r/template-03-02-3.edn
  • resources/corpus/j/template-04-04-0.edn
  • resources/corpus/p/template-03-02-0.edn
  • resources/corpus/a/template-05-01-0.edn
  • resources/corpus/v/yoga1_12-03-06-2.edn
  • resources/corpus/r/yoga1_12-09-06-3.edn
  • resources/corpus/d/yoga1-17-09-6.edn
  • resources/corpus/a/template-01-04-1.edn
  • resources/corpus/p/template-02-00-1.edn
  • resources/corpus/c/yoga1_12-10-02-2.edn
  • resources/corpus/d/yoga1_12-16-06-1.edn
  • resources/corpus/t/yoga1-17-08-2.edn
  • resources/corpus/c/template-00-02-0.edn
  • resources/corpus/r/yoga1_12-08-04-3.edn
  • resources/corpus/m/template-04-02-0.edn
  • resources/corpus/o/template-01-05-1.edn
  • resources/corpus/o/yoga1_12-03-06-0.edn
🚧 Files skipped from review as they are similar to previous changes (10)
  • resources/corpus/p/template-00-00-0.edn
  • resources/corpus/t/template-04-03-3.edn
  • resources/corpus/d/yoga1-16-01-1.edn
  • resources/corpus/t/template-03-01-1.edn
  • resources/corpus/d/yoga1-16-08-2.edn
  • resources/corpus/t/template-03-00-2.edn
  • resources/corpus/s/template-04-02-2.edn
  • resources/corpus/e/template-01-06-0.edn
  • resources/corpus/m/template-04-01-1.edn
  • src/steno/corpus.lpy

Comment thread src/steno/core.lpy
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