security: re-audit tail — traversal guard, step-budget parity, jsonstore Phase 1#155
Merged
Conversation
…parity (re-audit tail)
- agent_id traversal (Medium): _agent_dir now rejects '/', '\\', '..', leading
'.'/'~' (path-param endpoints pass agent_id raw; create_agent slugs are safe).
load_plan/state/manifest/grants catch the ValueError → degrade to empty so the
endpoints return 404, not 500, on a hostile id.
- step-budget parity (Medium): the non-streaming post-LLM [SKILL:] resolution
skipped _budget.consume('post_llm_skill_tag') that the streaming path enforces,
so stream:false could run skills past the per-turn cap. Now consumes + drops
the tag when exhausted, mirroring the stream path.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ase 1) Route the simple full-overwrite ~/.codec state writers through codec_jsonstore.atomic_write_json (tmp+fsync+atomic-replace+0600) instead of truncate-then-write, so a crash mid-write can't truncate state and a concurrent reader can't catch a half-written file: - codec_alerts (_save_state), codec_marketplace (meta + registry cache), codec_memory_upgrade (entity_map, sort_keys preserved), codec_imessage (save_state), codec_scheduler (save_schedules), skills/pomodoro (_write_state). Regenerated skills/.manifest.json (pomodoro.py changed — keeps its hash pin current so the load-time gate doesn't AST-refuse it; CI --check clean). Deferred to Phase 2/3: the notifications RMW writers (heartbeat/scheduler — need file_lock, not just atomic write) + the modules with their own atomic helpers (codec_proactive, codec_agent_messaging — Phase 3 convergence). codec_voice's marker left untouched (working voice pipeline). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Post-#154 cleanup. Three concerns, all TDD'd / verified, ruff clean, manifest current.
_agent_dirrejects/,\,..,leading./~; loaders degrade to empty → 404 not 500.[SKILL:]step-budget (Medium)Deferred (documented): #9 Phase 2 (notifications-RMW writers in heartbeat/scheduler → file_lock), Phase 3 (converge codec_proactive/agent_messaging own atomic helpers), Phase 4 (don't-touch config/token files); the #8 routes/chat.py split (hot-path move, complexity value already shipped in #154); codec_voice marker (working pipeline).
🤖 Generated with Claude Code