Add streamd daily. #87
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
file_type. e.g. 20260412-123456_dailyshould have file_typedaily`.streamd daily <date, e.g. 20260312>. This should open up the earliest entry withfile_type=dailyand moment within date. If no date given, today (in timezone from config) should be used.If no such file exist, a daily-file for right now should be created.
Updated Implementation Plan
Step 1: Add
file_typedimension toTaskConfiguration(src/localize/preconfigured.rs)Propagating ensures child shards (sub-entries) inherit the file type.
Step 2: Extract
file_typefrom filename (src/localize/datetime.rs+src/localize/shard.rs)Add a helper in
datetime.rs:Use the regex
^\d{8}(?:-\d{4,6})?_([a-zA-Z0-9]+)on the base filename.In
localize_stream_file(shard.rs), after inserting"file":Add tests for the new helper covering: with prefix, without prefix, with title after prefix, with full path.
Step 3: Add
Dailycommand variant tosrc/cli/args.rsStep 4: Implement
src/cli/commands/daily.rsUses the existing
load_repository_config()+RepositoryConfig.timezone(same astimesheetcommand):Key design decision: the
_dailysuffix is permanent (not renamed away like_wipinnew.rs), because the prefix is what identifies the file type.Step 5: Wire up in
src/main.rsandsrc/cli/commands/mod.rsIn
mod.rs:pub mod daily;In
main.rs:Step 6: Update
REQUIREMENTS.mdandREADME.mdDocument:
_<file_type>filename prefix conventionstreamd daily [YYYYMMDD]command (timezone comes from existing.streamd.tomltimezonefield)Files to create/modify
src/localize/preconfigured.rsfile_typedimensionsrc/localize/datetime.rsextract_file_type_from_file_name()src/localize/shard.rslocalize_stream_file()src/cli/args.rsDailyvariantsrc/cli/commands/daily.rssrc/cli/commands/mod.rsdailymodulesrc/main.rsREQUIREMENTS.mdREADME.mdstreamd dailycommand and file_type dimension #88Implementation Summary
Implemented in PR #88.
Duration: ~25 minutes
Tokens: ~50k (estimate based on session length)
What was done
file_typeextraction — Addedextract_file_type_from_file_nameinlocalize/datetime.rsusing regex^\d{8}(?:-\d{4,6})?_([a-zA-Z0-9]+). Wired intolocalize_stream_fileso the value is inserted intoinitial_locationand propagates to all children automatically (no config change needed for propagation, since initial_location values flow through the propagated map). Also registered the dimension inTaskConfigurationfor documentation.streamd dailycommand — New filesrc/cli/commands/daily.rs. Reusesload_repository_configfrom the timesheet module for timezone. Loads all.mdfiles, filters tofile_type=dailywithin the day's UTC bounds, sorts by moment, and opens the earliest match. Creates<timestamp>_daily.mdwith#content if no match.Key findings
initial_locationmap passed tolocalize_shardaspropagatedmeans filename-derived values (likefile_type) propagate to all child shards for free — no dimension entry inRepositoryConfigurationis needed for propagation (though it was added for documentation)._dailyprefix is permanent (unlike_wipinnew.rs) because it's the mechanism for identifying the file type.nix flake checkclean.