Conversation
cron.log, reminders.log and dream.log captured launchd/cron stdout and stderr verbatim, so a log showed what happened but never when. Scheduled jobs now set KIN_LOG_TIMESTAMPS=1 and kin prefixes each stdout/stderr line with the local ISO-8601 time its first character was written. Interactive and piped output is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015hsvicquw9yuB4UEdPyCoo
fbb466a to
32753c7
Compare
There was a problem hiding this comment.
Confidence Score: 1/5
Summary
Adds timestamps to scheduler logs, but the reviewed revision corrupts captured child JSON. Review is stale: the PR advanced from fbb466a to 32753c7 during validation.
Important Files Changed
| File | Overview |
|---|---|
| CHANGELOG.md | Documents timestamp opt-in and existing-install migration |
| src/kindex/cli.py | Installs timestamp wrappers before command parsing |
| src/kindex/dream.py | Enables timestamps for detached dreams |
| src/kindex/logstamp.py | Inherited opt-in also decorates machine-readable child output |
| src/kindex/scheduling.py | Preserves timestamp opt-in during crontab repacking |
| src/kindex/setup.py | Enables timestamps in cron and launchd environments |
| tests/test_cron_reliability.py | Updates expected scheduler environment assignments |
| tests/test_log_timestamps.py | Covers formatting and installation but misses captured child protocols |
| tests/test_reminder_action_safety.py | Updates crontab environment expectations |
Findings
- At fbb466a, scheduled actions and detached dreams propagate timestamping into child hooks, invalidating JSON; clear KIN_LOG_TIMESTAMPS for captured subprocesses and add regression coverage.
- Rerun review against current head 32753c7 before merging; the passing suite and reproduced regression cover only requested revision fbb466a.
KIN_LOG_TIMESTAMPS was inherited, so a scheduled reminder action that launched an agent had that agent's kin hooks stamp their JSON replies on a captured stdout, which broke them. install_from_env now removes the variable once read: only the process whose stdout is the log stamps. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015hsvicquw9yuB4UEdPyCoo
|
Confirmed and fixed in 6f963ba.
This comment answers the review of fbb466a. The current head is 6f963ba, rebased onto 🤖 Generated with Claude Code |
Summary
The scheduler logs in
~/.kindex/logs(cron.log,cron-error.log,reminders.log,reminders-error.log,dream.log) hold the raw stdout/stderr that launchd and cron redirect into them. They record what happened but never when. After this change each line starts with the local time it was written:How
src/kindex/logstamp.py. WhenKIN_LOG_TIMESTAMPSis set,kin'smain()wrapssys.stdoutandsys.stderrin a proxy that puts an ISO-8601 stamp at the start of each line. The time comes from when the line's first character is written, not from when the buffer flushes.setup.scheduler_environment()), the crontab lines (viasetup.cron_env_assignments(), which the adaptive repack inscheduling._apply_crontabalso uses) anddream.detach_dreamall set the variable.--jsonincluded.install_from_envremoves the variable once it has read it, so only the process whose stdout is the log stamps. A scheduled reminder action launches agents whosekinhooks answer in JSON on a captured stdout, and an inherited opt-in would stamp that JSON and break it. Anything a scheduled job launches writes to the inherited log unstamped.Existing installs pick this up once someone re-runs
kin setup-cron. The CHANGELOG entry says so.Tests
tests/test_log_timestamps.pycovers line splitting across partial writes, blank lines, the falsey env values, idempotent install, children not inheriting the opt-in,main()with and without the variable, and the crontab, plist and dream env wiring.test_cron_reliability.pyandtest_reminder_action_safety.pynow include the newKIN_LOG_TIMESTAMPS=1token.mainon my machine, because the tests pick up my local profile config and my globalcore.hooksPath. CI should show whether they pass on a clean machine.🤖 Generated with Claude Code
https://claude.ai/code/session_015hsvicquw9yuB4UEdPyCoo
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.