Skip to content

fix(worklog): three cold-start reliability improvements for preamble.sh - #29

Merged
cheshirecode merged 4 commits into
mainfrom
codex/worklog-protocol-efficiency-1786256438
Aug 9, 2026
Merged

fix(worklog): three cold-start reliability improvements for preamble.sh#29
cheshirecode merged 4 commits into
mainfrom
codex/worklog-protocol-efficiency-1786256438

Conversation

@cheshirecode

Copy link
Copy Markdown
Owner

Summary

Three small independently-testable fixes for the Worklog preamble and sync mode, all surfaced by a cold-start protocol iteration pass:

1. Accept --light as a preamble alias

preamble.sh rejected --light (exit 2) even though SKILL.md and init.md document it as a valid flag mapping to minimal mode. Fixed by adding --light as a recognized alias that normalizes to --minimal before dispatch.

2. Re-compute active counts after pull

active_namespace was computed before the pull but used in the roster-health count comparison after it. If the pull adds or removes tasks, the stale pre-pull count could mask cache-staleness. Fixed by re-computing both counts after the pull block.

3. Fix stale CLAUDE_HOOK env var in sync.md

The non-interactive guard referenced $CLAUDE_HOOK which does not exist. Replaced with the correct session identifiers (CLAUDE_CODE_SESSION_ID, CODEX_SESSION_ID, CURSOR_SESSION_ID, OPENAI_SESSION_ID) used by bin/_lib.sh::resolve_session_id.

Validation

  • bash tests/run.sh all: 75 pass, 0 fail
  • bash skills/worklog/tests/cache/test_stale_consumers.sh: ok
  • bash skills/worklog/tests/init/test_light_init.sh: all 3 checks pass (--minimal, --light, --bogus rejection)
  • Live _worklog dogfood with --light and --full: LDAP=oss, roster correct, no state mutation
  • Cross-task lint: 13 pre-existing errors (misspelled archived/ dir), no regression from these changes

Worklog-Slug: worklog-protocol-efficiency

preamble.sh rejected --light (exit 2) even though SKILL.md and init.md documented it as a valid flag mapping to minimal mode. Add --light as a recognized alias that normalizes to --minimal before dispatch.
active_namespace and active_total were computed before the pull but used in the roster-health count comparison after it. If the pull adds or removes tasks, the stale pre-pull count masks cache-staleness. Re-compute both counts after the pull so the comparison uses current state.
…Ds in sync.md

 does not exist in the codebase. The actual session identifiers are CLAUDE_CODE_SESSION_ID, CODEX_SESSION_ID, CURSOR_SESSION_ID, and OPENAI_SESSION_ID (see bin/_lib.sh::resolve_session_id).
Verify preamble.sh rejects --bogus with non-zero exit.
@cheshirecode
cheshirecode merged commit 0511f55 into main Aug 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant