Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Conversation

@disconcision
Copy link
Member

No description provided.

disconcision and others added 8 commits January 11, 2026 23:30
CLI implementation (src/CLI/):
- Rust-style error formatting with source context, line numbers, carets
- evaluate_with_probe_map for probe sample collection
- All commands working: run, format, analyze, probe (with --many)

Documentation (plans/hazel-lsp-cli/):
- cli-api.md: Complete CLI reference with examples
- hazel-primer.md: Comprehensive Hazel syntax guide
- hazel-builtins.md: Full builtin list with OCaml/ReasonML differences
- vision.md: Long-term direction (semantic views, structural queries)
- experience-log.md: AI experience tracking workflow
- README.md: Project plan with status tracking

Sample programs (hazel-programs/):
- 9 documentation programs extracted from ML slides
- 39 B2T2 programs extracted from ML slides
- Folder structure for study tasks and examples

Utilities (scripts/):
- extract-docs.py: Extract .hz programs from ML backup_text fields

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
CLI test command (src/CLI/):
- ./hazel test runs tests and reports pass/fail with line numbers
- Shows hint strings for named tests (hint "name" test ... end)
- Supports --verbose flag to show all tests
- Exit code 0 = pass, 124 = failures

Study program infrastructure (plans/study-programs.md):
- Requirements for probe debugging user study programs
- Development process and bug design guidelines
- Tiered list of program concepts ready for parallel implementation
- Probe mechanism overview from codebase research

Example programs:
- emojipaint.hz: Working version with comprehensive tests
- emojipaint-bug.hz: Buggy version with single failing test
- Proper indentation applied to both

Documentation updates:
- cli-api.md: Full test command documentation
- hazel-primer.md: Named tests, debugging workflow with probes
- README.md: Updated status and TODOs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Three new programs for probe debugging user studies:

Tic-Tac-Toe (~265 lines, 18 tests):
- 3x3 board with win/draw detection
- Bug variants: wrong diagonal indices, turn not alternating

Game of Life (~230 lines, 20 tests):
- Cellular automaton with birth/death rules
- Bug variants: missing diagonal neighbors (easy), wrong survival
  threshold (medium), sequential instead of simultaneous update (hard)

Calculator (~270 lines, 28 tests):
- Expression parser with operator precedence
- Tokenizer, recursive descent parser, evaluator
- Bug variants: flat precedence, right-associativity

Documentation updates:
- hazel-primer.md: Added note about comment syntax
- experience-log.md: Documented eval reserved name and comment gotchas
- Each program folder has detailed README with bug descriptions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.66%. Comparing base (ab19caf) to head (26eadd4).

Additional details and impacted files
@@              Coverage Diff              @@
##           probe-III    #2056      +/-   ##
=============================================
+ Coverage      49.95%   50.66%   +0.71%     
=============================================
  Files            230      219      -11     
  Lines          25600    25105     -495     
=============================================
- Hits           12788    12719      -69     
+ Misses         12812    12386     -426     
Files with missing lines Coverage Δ
src/haz3lcore/ProbePerform.re 9.12% <ø> (-0.04%) ⬇️
src/haz3lcore/lang/Token.re 81.25% <ø> (ø)
src/haz3lcore/projectors/ProbeText.re 0.00% <ø> (ø)
.../haz3lcore/projectors/implementations/ProbeProj.re 1.19% <ø> (-0.06%) ⬇️
src/haz3lcore/zipper/Printer.re 87.50% <ø> (+0.54%) ⬆️
src/haz3lcore/zipper/action/Action.re 0.00% <ø> (ø)
src/haz3lcore/zipper/action/SampleCursorPerform.re 20.00% <ø> (ø)
src/haz3lcore/zipper/action/Triggers.re 76.33% <ø> (-4.16%) ⬇️
src/language/dynamics/Sample.re 44.01% <ø> (+30.72%) ⬆️
src/language/dynamics/state/EvaluatorState.re 64.17% <ø> (+0.11%) ⬆️
... and 3 more

... and 44 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from probemoar to dev January 16, 2026 23:03
disconcision and others added 20 commits January 16, 2026 18:42
CLI changes:
- Add --auto/-a flag to ./hazel probe command
- When enabled, uses AutoProbe.ids_to_autoprobe to automatically
  place probes on expressions (one per line heuristic)
- Works with existing --many flag for multiple samples

Study-write tasks for probes user study:
- basepoint: tiny task, parameter order ambiguity
- clamp: tiny task, condition boundary errors
- running-sum: small task, fold accumulator errors
- Each has sketch, solution, and storyboard files
- Tests formatted with line breaks for auto-probe visibility

Also includes:
- study-write-plan.md: research questions, task categories, design notes
- cli-autoprobe-proposal.md: implementation design document
- session-log.md: example incremental CLI session

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Replace verbose ^^probe(...) with cleaner ⟦...⟧ brackets in CLI output
- Fix probe values appearing on first line of multi-line expressions
  (now correctly placed at end of expression using m.last.row)
- Add Token.probe_start/probe_end constants for Unicode brackets
- Add refractor_seg_to_seg_text for customizable probe rendering

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Changed ~indent="" to skip Printer's computed indentation, which was
causing output to have different (usually more) indentation than the
source file. The computed indentation is designed for Hazel's structural
editor, but CLI output should preserve the original whitespace from the
parsed segment.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Botanical/celestial themed tutorial introducing probes:
- Seeing values with basic probes
- Environment hover for variable values
- Branches and the ∅ (not evaluated) icon
- Functions and multiple samples
- Closure cursor and sample alignment
- Single/many mode, arrow key navigation

Uses ⟦⟧ bracket notation to represent probed expressions in text.
Sets up for Part 2: larger Greenhouse Planner program with debugging.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
New study-write tasks with sketch/solution pairs:
- emojipaint-extend: Extend emoji paint with new brush feature
- last-element: Find the last element of a list
- mentions: Extract @mentions from text
- safe-head: Safe version of list head with Option type

Each task includes storyboard documentation for guided exploration.
Also adds task-ideas.md and CLI syntax exploration notes.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
New commands:
- ./hazel gen-slides: Generate ML slide files from hazel-programs/examples/
- ./hazel gen-slides-clean: Remove generated files and restore empty stub

Features:
- Recursively finds all .hz files in the examples directory
- Parses each file and serializes to PersistentSegment format
- Generates individual ML files for each program
- Creates AllExamples.re aggregation module
- Strips leading indentation before parsing (configurable)
- Hierarchical slide titles based on directory structure

Configuration in src/CLI/GenSlides.re (input_dir, output_dir, root_title, etc.)

Integration:
- Added examples library to web dependencies
- Added Examples.AllExamples.all to Init.re documentation list
- Stub AllExamples.re allows build to succeed when slides not generated

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Resolve merge conflicts from refactors.manuals changing from Id.Map.t
to RefractorList.t (association list). Updated call sites to use list
operations instead of Id.Map operations:

- Printer.re: Use [] instead of Id.Map.empty for default refractors
- Triggers.re: Update type annotations and use List.assoc_opt,
  ListUtil.remove_assoc, List.is_empty
- Cli.re: Build refractor list instead of Map, fold into list
- ProbeSidebar.re: Add missing projector_list arg to mk_view,
  convert manuals to Map for RefractorView.mk_data
- Test_ExpToSegment.re: Use [] for empty refractors

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Convert recursive do_until and do_until_piece functions in Zipper.re to
iterative implementations using while loops. The previous recursive
versions would overflow the JavaScript call stack when traversing
documents with thousands of tokens.

Also includes related refactoring:
- Move Sample.Capture type to its own submodule in Sample.re to avoid
  type inference issues with overlapping field names
- Add clear_transient() to EvaluatorState to prevent serializing large
  app_args data (~100MB+) over postMessage
- Only store app_args for probe target IDs to reduce memory usage

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@disconcision disconcision changed the base branch from dev to probe-III February 4, 2026 06:35
disconcision and others added 17 commits February 4, 2026 01:48
When a function argument is syntactically just a variable (e.g., g(x)),
filter that variable from the environment display since its value is
already visible in the call display (e.g., g(5)).

- Add get_arg_var_names to extract variable names from direct Var args
- Handles tuples: f(x, y+1) filters x but keeps y
- Handles parenthesized expressions
- Update sample_environment to accept filter_vars parameter

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The autosave was slow because ScratchMode.persist was calling
PersistentZipper.unpersist on every original documentation slide
on every save, just to compare if they had changed.

This adds a lazily-initialized cache in Init.re that stores the
original segments, so the comparison is now a fast map lookup
instead of re-parsing S-expressions.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The stack_frame type was a tuple (Id.t, option(string)) where the
optional string (function name) is purely informational. Many comparison
sites used structural equality (==) on stack frames, which broke after
step-into because the cursor constructs frames with name=None while
evaluation produces frames with name=Some("f"). This caused the sample
selection logic to fail even though filter_by_pin (which used
ids_of_stack) worked correctly.

Changes:
- Convert stack_frame from tuple to record {id, name}
- Add equal_stack_frame (id-only) and equal_call_stack helpers
- Fix all comparison sites to use id-only equality
- Add ~eq parameter to ListUtil suffix/comparison functions

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Test_SampleSelection.re (28 unit tests): Tests pure Selection/Cursor
logic with hand-crafted samples. Covers equal_stack_frame, Cursor.relation,
filter_by_pin, select in Single/Many modes, is_same_call, closest_to_cursor,
and get_empty_status. Includes regression tests for None-vs-Some name
mismatch that caused the step-into bug.

Test_Evaluator_ProbeSelection.re (11 integration tests): Evaluates real
programs, then pipes samples through Selection with simulated cursor/pin
states. Tests step-into scenarios, pin filtering between calls, cursor
relation classification, and Single vs Many mode behavior with real data.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add fn_def_id to stack_frame for jump-to-definition from built-in
internal calls. Add fallback navigation for built-in function entries:
when clicking a name or separator that points to non-navigable built-in
code, walk up the call stack to the nearest user-visible call site.

Key fix: HazelFn built-ins use a "+" suffix on internal names (e.g.
"fold_left+"), so strip it before checking Builtins.env_init to
correctly identify built-in entries and skip non-navigable definition
targets.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Simplify click handlers to uniformly set cursor index to the clicked
entry's depth, regardless of whether the jump target is a direct
definition or a fallback. The jump target and cursor index are
independent concerns: the cursor reflects what depth you're inspecting,
not where the syntax jump lands.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Change name clicks from jump-to-definition to jump-to-call-site for
more intuitive backtracking. Separators become decorative (no click).
Add body icon at end of bar to jump to the innermost function
definition, preserving the ability to navigate forward after
backtracking.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
When stepping deep into a call stack, probes on application expressions
that are part of the pinned call chain now remain visible instead of
being filtered out. Only probes whose ap_id matches a frame in the
pinned stack are kept, so sibling branches and non-application probes
at shallower depths are still filtered.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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