fix(chronicle): backup append entries to mktemp, not entries/#32
Merged
Conversation
A reviewer flagged that \`cp "\$target" "\${target}.append-backup"\` was
collision-prone — if a prior \`chronicle.sh append\` was killed between
the cp and the success path (OS signal, validator hung), the next run
would silently clobber the orphaned backup with the (possibly already
mutated) live entry, destroying the only good copy.
Fix: use \`mktemp -t\` so backup and tmp files land in \$TMPDIR with
unique names. Collisions are now impossible, and chronicle/entries/
stays free of script-internal files even after a crash.
No test changes; harness still 33/33.
argen
added a commit
that referenced
this pull request
May 20, 2026
…#37) Three PRs landed this session (#30 chronicle append-semantics, #31 resources layer PR 2, #32 mktemp fix) and the front-door docs hadn't caught up. Updated counts and added coverage for what shipped: - README: - Skill count: 37 → 38 PM (added hubspot-pipeline-readout in #31). - Cross-role count: 8 → 16 (added ingest, prep, review, hypothesis-track, stakeholder-update, customer-update, query-issue-tracker, query-warehouse). - Slash commands: 6 → 12 (matched the new skills). - Themes table: hubspot-pipeline-readout added under Operations. - Cross-role list restructured into four sub-groups (harness primitives / chronicle write+read / chronicle append-shaped / chronicle workflow / cross-system primitives). - Resources table: jira/bigquery/snowflake/hubspot promoted to stable with their consumer skills named; github added explicitly; claude.ai-native cards (canva, gmail, google-calendar, google-drive, intercom) folded into the stable group. - Chronicle section rewritten to cover all four entry types (decision / hypothesis / stakeholder / customer), the sourcing hierarchy, and the append exception with the three append-shaped skills. - New /catalog table rows for /ingest, /prep, /review, and the three append commands. - DISPATCHER: "eight cross-role" → "sixteen cross-role". - playbooks/onboarding.md, role-cheatsheet.md: skill counts updated to match. No content changes outside doc strings; smoke-check still 12/12.
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
Follow-up to #30. A code-review agent flagged that `cp "$target" "${target}.append-backup"` was collision-prone: if a prior `chronicle.sh append` was killed between the cp and the success path (OS signal, validator hung), the next run would silently clobber the orphaned backup with the (possibly already mutated) live entry, destroying the only good copy.
Fix: use `mktemp -t` for both the backup and the awk tmp file so they land in $TMPDIR with unique names. Collisions are impossible, and `chronicle/entries/` stays free of script-internal files even after a crash.
Commits
Test plan
🤖 Generated with Claude Code