Missed commit recovery #74
Merged
Merged
Conversation
Contributor
Reviewer's GuideThis PR extends the timep profiling framework to detect and synthesize missing log entries for orphaned background forks, tightens regexes in the log parser, defers debug trapping until actual user functions run, enriches background-function profiling, consolidates trap and variable declaration logic, refines sed-based log merging (with hotfixes for empty commands), and refreshes all test fixtures accordingly. Sequence diagram for missed commit recovery and synthetic background fork log entry creationsequenceDiagram
participant ParentProcess
participant ChildProcess
participant LogProcessor
participant LogFile
ParentProcess->>ChildProcess: Forks background job
ChildProcess->>LogFile: Writes log entries
LogProcessor->>LogFile: Reads parent and child logs
LogProcessor->>LogFile: Checks for missing child log entries in parent log
alt Orphaned log detected
LogProcessor->>LogFile: Synthesizes << (BACKGROUND FORK): ... >> entry in parent log
end
LogProcessor->>LogFile: Updates parent log with synthetic entry
LogProcessor->>ParentProcess: Continues log processing
Entity relationship diagram for log files and synthetic entrieserDiagram
LOG_FILE ||--o{ LOG_ENTRY : contains
LOG_FILE ||--o{ SYNTHETIC_ENTRY : contains
LOG_ENTRY {
string id
string type
string command
string timestamp
}
SYNTHETIC_ENTRY {
string id
string type
string command
string timestamp
string reason
}
Class diagram for updated timep profiling state and flagsclassDiagram
class TimepState {
- timep_IS_BG_FLAG : bool
- timep_IS_SUBSHELL_FLAG : bool
- timep_IS_FUNC_FLAG : bool
- timep_IS_BG_FUNC_FLAG : array<bool>
- timep_SKIP_DEBUG_FLAG : bool
- timep_SKIP_DEBUG_UNTIL_FUNC_FLAG : bool
- timep_BG_FUNC_RETURN_TRAP_FLAG : bool
- timep_SUBSHELL_INIT_FLAG : bool
- timep_NO_PRINT_FLAG : bool
- timep_NEXEC_A : array<int>
- timep_FNEST : array<int>
- timep_NEXEC_HASH_A : array<string>
- timep_BASH_COMMAND_PREV : array<string>
+ trapSetup()
+ logEntryRecovery()
+ processLog()
}
class LogProcessor {
+ processLog()
+ synthesizeBackgroundForkEntry()
+ mergeLogs()
}
TimepState <|-- LogProcessor
Class diagram for log entry parsing and merging routinesclassDiagram
class LogEntry {
- tw : string
- pw : string
- tc : string
- pc : string
- cnt : string
- nd : string
- lno : string
- cind : string
- cmd : string
}
class LogParser {
+ parseLogEntry(line: string) LogEntry
+ mergeLogEntries(entries: LogEntry[])
+ hotfixEmptyCommand(entry: LogEntry)
}
LogParser --> LogEntry
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
added 2 commits
October 19, 2025 01:32
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.
Summary by Sourcery
Implement missed commit recovery by reconstructing orphaned background forks and functions, improve debug trap control and log processing, refine output formatting, and update test fixtures.
New Features:
Bug Fixes:
Enhancements:
Tests: