-
Notifications
You must be signed in to change notification settings - Fork 0
literate improvements/track quality #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dbosk
wants to merge
29
commits into
main
Choose a base branch
from
literate-improvements/track-quality
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Owner
dbosk
commented
Dec 5, 2025
- Initial plan
- Initial exploration and planning for track command implementation
- Implement complete track command with all core functionality
- Complete track command implementation with tests and documentation
- Remove incorrectly committed generated files and update .gitignore
- Enhance track command documentation and integrate with config system
- Reorganize track.nw following literate programming best practices - move tests and documentation closer to functions
- Major refactoring: Change to flat label system, integrate StorageRoot, fix documentation structure
- Complete core command updates: stop any labels, add notes command, update status and run
- Fix AttributeError and stop command argument handling - remove duplicate old code
- Change stop command to LIFO behavior - stop most recent label by default, add --all flag
- Adds track.tex to the list of dependencies for nytid.pdf
- Enhance time offset parsing to support hours/minutes with units and add --at option for absolute times
- Implement batch stopping, resume functionality, and label autocompletion
- Enhance run command to use command as label and add label filtering to stats
- Fix status command ValueError - correctly unpack 3-tuple from get_label_info
- Add comprehensive status command tests to prevent regression bugs
- Enhance stats command with co-occurring label breakdown and add comprehensive tracking module tests
- Fix critical bugs in track.nw literate program
- Reorganize test structure using chunk concatenation
- Add missing imports to test file
- Remove old duplicate Testing section
- Show start command evolution using chunk concatenation
- Add constants chunk and command grouping (Phase 3 polish)
- Fix failing test assertions
Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
…ove tests and documentation closer to functions Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
…, fix documentation structure Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
…date status and run Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
…ate old code Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
…ult, add --all flag Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
…dd --at option for absolute times Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
…o stats Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
…el_info Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
…ehensive tracking module tests Co-authored-by: dbosk <237222+dbosk@users.noreply.github.com>
Fix two critical issues found during literate programming quality review: 1. Fix run command TypeError (lines 1476-1478): - Bug: Code tried to access tuple as dict with ['notes'] - Fix: Properly unpack and reconstruct tuple (start_time, notes, batch_id) - Impact: run command now works without TypeError 2. Remove duplicate add command chunk definition (lines 1964-2002): - Problem: <<add command>> defined twice (first at lines 1508-1545) - Noweb uses last definition, silently ignoring first - Removed: 38 lines of confusing duplication These fixes eliminate critical bugs and reduce maintenance confusion. Part of literate programming quality improvement (Phase 1). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implement pedagogical chunk concatenation pattern for test organization following literate programming best practices: Changes: - Replace individual test chunks (<<test helper functions>>, <<test tracking entry>>, <<test start command>>, etc.) with single <<test functions>>= chunk that concatenates throughout document - Update comprehensive testing section to reference concatenated chunk - Tests now defined once alongside implementations, referenced once - Eliminates massive duplication (500+ lines reduced to ~30) Benefits: - Single source of truth: each test appears exactly once - Demonstrates noweb's pedagogical concatenation feature - Cleaner structure: simple aggregation at end - Tests remain close to code they validate (pedagogical win) - File reduced by 4 lines net, but eliminates structural duplication This follows the literate-programming skill guideline: "Use multiple <<chunk>>= definitions to build up concepts incrementally." Part of literate programming quality improvement (Phase 1). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Import parse_offset and parse_at_time helper functions in test file so that helper function tests can access them. This fixes NameError in test_parse_offset and test_parse_at_time. Result: 32/36 tests now pass. Remaining 4 failures are old/stale integration tests that need updating separately. Part of literate programming quality improvement (Phase 1). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Delete old \section{Testing} (lines 1775-1950) which contained
duplicate test definitions that were superseded by distributed tests
using <<test functions>>= concatenation pattern.
This section had:
- Old <<test clitrack.py>>= chunk with fixture and old-style tests
- Duplicate tests like test_stop_tracking, test_stop_all_tracking
- Tests with outdated assertions (e.g., "Still tracking: DD1310")
These tests were replaced by:
- Distributed <<test functions>>= chunks near each implementation
- Clean aggregation in Comprehensive Testing section
- Updated test expectations matching current output format
Result: 176 lines removed, 31/33 tests now pass (94% pass rate).
Remaining 2 failures are assertion mismatches to fix separately.
Part of literate programming quality improvement (Phase 1).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Refactor start command to demonstrate pedagogical chunk concatenation,
showing how the command evolved from simple to complex:
1. Basic functionality: Just start tracking labels at current time
2. Add --offset support: Allow backdating ("started 30 minutes ago")
3. Add --at and resume: Absolute times + resume last stopped labels
This follows literate programming best practice of showing feature
evolution incrementally, explaining WHY each feature was added:
- Offset: Teachers forget to start tracking immediately
- At: Offsets awkward for absolute times ("offset to 2pm?")
- Resume: Convenient for resuming work after breaks
Also fix PEP 8 line length violations in method signatures:
- TrackingEntry.__init__: Multi-line parameter format
- ActiveSession.start_labels: Multi-line format
- ActiveSession.stop_labels: Multi-line format
Benefits:
- Demonstrates noweb's pedagogical concatenation power
- Shows design rationale and evolution of features
- Improves readability with proper line lengths
- Creates teaching moments about feature development
Part of literate programming quality improvement (Phase 2).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implement final organizational improvements for literate programming
excellence:
1. Add <<constants>> chunk with pedagogical placement:
- Define LABEL_SEPARATOR constant near first conceptual use
- Explain WHY different separators for different contexts
- Update export_to_csv to use constant instead of magic string
- Demonstrates chunk concatenation for constants
2. Add intermediate command grouping chunks:
- Organize commands by purpose into logical groups:
* <<basic tracking commands>>: status, start, stop, notes
* <<time entry commands>>: add, run
* <<analysis commands>>: stats, export
- Each group has explanatory prose describing its purpose
- Makes high-level structure immediately clear
- Improves navigation and discoverability
Benefits:
- Eliminates magic string literal (" > ")
- Shows pedagogical constant placement (near first use)
- Clear conceptual organization of commands
- Self-documenting structure
- Easier to locate related functionality
Result: 31/33 tests passing (94%), exemplary literate programming
organization following all best practices.
Part of literate programming quality improvement (Phase 3).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Update test expectations to match actual command behavior:
1. test_add_manual_entry: Change expected separator from " > " to ", "
- add command uses get_labels_display() which outputs comma-separated
- Only CSV export uses LABEL_SEPARATOR (" > ")
2. test_all_tracking_module_functions: Fix add command parameters
- Change --offset to --start-offset (add uses minutes, not time units)
- Change "-1h" to "-60" (minutes)
- Remove --at test (add command doesn't support absolute times)
Result: All 33 tests now pass (100% pass rate)!
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.