Skip to content

Harden std_run timeout retry internals and section logs #112

Description

@codeforester

Summary

Claude's latest review found three actionable std_run timeout/retry issues and one low-risk file logging cleanup:

  • __std_run_once__ discovers timeout/gtimeout on every retry; discover once in __std_run_impl__ and pass the resolved path through.
  • __std_run_with_timeout_fallback__ returns 127 when its marker temp file cannot be created; return 1 so callers do not confuse infrastructure failure with command-not-found.
  • The timeout fallback parent currently terminates the timer with the default SIGTERM. Use SIGKILL for the timer after the command exits so the timer cannot run cleanup and remove the marker before the parent reads it.
  • update_file_section logs Updating even when adding a section for the first time; log Adding section to ... for the append path.

Acceptance criteria

  • Add focused failing tests for timeout discovery count, fallback temp-file failure status, timer SIGKILL, and append-path log wording.
  • Implement the minimal code changes to pass those tests.
  • Run focused BATS suites and the full validation gate.

Validation

  • bats lib/bash/std/tests/lib_std.bats
  • bats lib/bash/file/tests/lib_file.bats
  • ./tests/validate.sh
  • git diff --check

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions