Conversation
## Parser (lib/mps/engines/mps.rb) - Replace brittle flip-flop at_first/scan_until algorithm with a correct position-based stack parser using Regexp#match(str, pos) per iteration. Stack frames carry sign, args, body_start, child_counter, ref_path — refs are built naturally from parent path, no mutation bugs. - Make element brackets optional in AT_REGEXP so @task{ } and @task[]{ } are both valid. Previously bracketless syntax was invisible to the parser, causing lost elements and premature root closure. - Rename class Engines::MPS → Engines::Parser; MPS alias kept for compat. - Replace eval()/instance_eval() with const_get and a plain Struct for Unknown elements. - Fix typo: parse_mps_file_to_elments_hash → parse_mps_file_to_elements_hash (old name aliased). ## Constants (lib/mps/constants.rb) - Fix AT_REGEXP sign char class (was [a-zA-Z0-9_,:\s]+? — wrongly matched spaces/commas); now [a-zA-Z0-9_]+. - Fix MPS_FILE_NAME_CLIPPER to guard against non-matching filenames (was $~[1] which crashed; now uses match() with a safe fallback). ## Element types (lib/mps/elements/) - Add Element.split_args module method: parses "work, status: done" into { attrs: { status: "done" }, tags: ["work"] }. - All elements: add parse_args, parsed_args, raw_args, tags accessors. - Fix SIGNATURE_REGEX from partial /task/ to exact /\Atask\z/ on all types. - Fix frozen_string_literal magic comment typo (space → underscore). - Task: add done?/open?, status arg (default "open"). - Log: add duration_minutes, duration_str from start/end args. - Reminder: expose at arg. ## Store (lib/mps/store.rb — new) - Library layer that owns all filesystem work: find_file, find_files, find_or_create_path, parse_date, append, all_files, files_since, search. - CLI delegates entirely to Store; no direct file I/O in lib/cli/mps.rb. - Fix Dir.glob().grep(regexp) → .select { File.basename(f) =~ regexp } (grep was matching full paths against a basename-anchored regexp). ## CLI (lib/cli/mps.rb — full rewrite) - New commands: list (nested tree with --type/-t, --tag/-g, --status/-s, --since/-S), append (--tags, --status, --at, --start-time, --end-time), search (--type, --tag, --since), stats (--since), export (--format json|csv, --type, --since). - list renders elements as an indented tree ordered by ref path; @mps group headers shown only when they have visible children. - --status filter correctly excludes elements that carry no status field. - colorized type badges (green/cyan/magenta/yellow), status/duration/time extras. - Fix git pull orign → configurable git_remote/git_branch from config. - rescue Exception → rescue StandardError throughout. ## Tests - engine_test.rb: updated for new API; added sibling refs, deep nesting, args capture, Unknown struct tests. - element_test.rb (new): 20 tests — split_args, parse_args, done?, duration_str, reminder at, note tags. - store_test.rb (new): 19 FakeFS tests — find_file, parse_date, append, search, files_since. - assets_test.rb (new): 13 regression tests against real fixture files exercising bracketless syntax, mixed files, and 3-level nesting. ## Docs - GETTING_STARTED.md: rewritten as comprehensive day-in-the-life narrative covering every command and option with examples. - README.md: updated command list, architecture overview, before/after table comparing pre-Claude baseline (66ac095) to current state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
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.
Release 0.5.0 includes changes to make it ready to use