Repository navigation
docs: close the last stale Codex parity claims (follow-up to #620) - #625
Conversation
Advisor cleanup pass. Four items, all verified against the code first. The timeout test still carried the round-1 claim that session_lifecycle "survives" the 3-second ceiling by detaching consolidation. My own later measurement contradicted that and the docs already said the opposite, so the comment now matches: detaching is not enough, 3.46s on the first run, and the limitation is named rather than implied. The eleven-to-digit conversion was half done. `.codex-plugin/plugin.json` was not scanned by the doc-claim gate at all, and its `description` and `longDescription` both state the hook count to every installer a marketplace shows it to. Those two, the package SECURITY.md and the Unreleased CHANGELOG entry now use digits, and the manifest joins SCANNED_FILES. The gate sees ten hook-count claims now, including the two shipped marketplace strings. Mutation-checked: staling either manifest string, or the SECURITY.md one, fails the gate. The pointer to where HOOK_MODULES is imported was left behind by the round-2 file split; it now names `_codex_plugin_support.py` and the hooks contract test that asserts both hosts dispatch that exact set. The session-end limitation said recording "can be lost" without saying what. Traced `process_event` in mcp_server/hooks/session_lifecycle.py: only `_spawn_consolidation` is detached, and `save_session_log` (the session-log row) and `save_profile` (the per-domain profile delta) both run inline before it. A kill at three seconds therefore loses the session record itself, not a consolidation pass, and nothing retries it. The note now lists the four inline steps in order and says so. It also names the mechanism a fix would use (`main()` already dispatches on `argv[1] == "--consolidate"`) while stating plainly that the decision is not made here. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cz7A6goxVzfKL9NT7k4zDH
|
ZETETIC-REVIEW: APPROVE Follow-up to #620 (merged), pure documentation and test-comment cleanup, four items, no code path touched. Verified the diff directly (46 additions, 20 deletions, 6 files): the stale session_lifecycle test comment now points to CODEX_SESSION_END_MAX where the rationale lives; the eleven-versus-digit doc-claim gap is closed, including the shipped .codex-plugin/plugin.json manifest strings that a Codex marketplace shows to every installer, which is the one the implementer found on their own beyond the three I originally flagged; the stale HOOK_MODULES import pointer in docs/codex-plugin.md now names the correct files after the round-2 split; and the SessionEnd limitation section is now concrete rather than vague, naming the exact inline steps (session-log row, profile delta) that a cold-start kill loses, with the fix mechanism named and the decision explicitly left open rather than made here. CI green, no pending jobs, no failures. Craftsmanship, doc-claims and lint gates confirmed by the implementer in the same lint-only venv reproduction used earlier in this session, since this PR touches SCANNED_FILES scope. |
Summary
Follow-up to #620. Four polish items an advisor review raised after that PR was already merged, kept deliberately narrow: no behaviour changes, no new surface, six files.
test_codex_plugin_hooks_contract.pystill carried the original claim thatsession_lifecycle"survives" Codex's 3-secondSessionEndceiling by spawning consolidation detached. The measurement taken later in feat(codex): full profile and the same eleven lifecycle hooks under Codex #620 contradicted that, anddocs/codex-plugin.mdalready said the opposite. The rationale now lives onCODEX_SESSION_END_MAX, where the number it explains is defined.plugins/hypermnesia-mcp-codex/.codex-plugin/plugin.jsonwas not incheck_doc_claims.py'sSCANNED_FILESat all, and itsdescriptionandlongDescriptionboth state the hook count to every installer a Codex marketplace shows it to. Those two, the packageSECURITY.md, and the[Unreleased]CHANGELOG entry now use digits, and the manifest joinsSCANNED_FILES.docs/codex-plugin.mdsaidtest_codex_plugin_contract.pyimportsHOOK_MODULES; the round-2 file split in feat(codex): full profile and the same eleven lifecycle hooks under Codex #620 moved that to_codex_plugin_support.pyand the hooks contract test.SessionEndlimitation said what could be lost without saying what. Now concrete, see below.Closes nothing; there is no open issue for these.
Type of change
What a session-end kill actually costs
The limitation note in #620 said session-end recording "can be lost" without naming what. I traced
process_eventinmcp_server/hooks/session_lifecycle.pyrather than repeating the summary: only_spawn_consolidationis detached, and it runs last. Before it, inline and in order:load_profiles()andload_session_log()_append_session(...)thensave_session_log(log), the session-log rowapply_session_update(...)thensave_profile(domain_id, dp), the per-domain profile delta_spawn_consolidation(...), the only detached partSo a hook killed at three seconds loses the session record itself, not a consolidation pass, and nothing retries it: the next
SessionStartdoes not reconcile a missing row. The note now says that, and names the mechanism a fix would use (main()already dispatches onargv[1] == "--consolidate") while stating plainly that the decision is not made here.This is the one item that is arguably more than polish. It is documented, not fixed, because moving steps 1 to 3 behind that detached re-invocation has its own durability trade-offs and belongs to whoever owns that module.
Test plan
The doc-claim gate now sees ten hook-count claims across six files, including the two shipped marketplace strings that were previously invisible to it:
Mutation-checked, each reverted after:
Gates, on the final state
The Lint job was also reproduced in a venv with only
requirements/lint.txtinstalled, since this PR touchesSCANNED_FILESand that job has no project package importable:The two
tests_py/hooks/failures are pre-existing and environmental, not from this diff:deps/pydantic_core/_pydantic_core.cpython-312-darwin.soagainst a 3.13.7 interpreter in the local worktree. This branch changes no file undermcp_server/.Audit notes
session_lifecycle.pywas re-verified against the source before being written into the doc, not relayed.uvxguard string is still duplicated across all 11 entries of both manifests, with only tests enforcing parity. Noted as debt indocs/codex-plugin.mdduring feat(codex): full profile and the same eleven lifecycle hooks under Codex #620; generating both manifests from one template remains the real fix and is out of scope here.Coding-standards compliance
anyor untyped dicts at boundaries in production code.Breaking changes
None. Documentation and one test comment; the only executable change is four strings in
SCANNED_FILESand the manifest path added to it.Reviewer checklist
[Unreleased]entry rather than adding one; the change is prose in a claim feat(codex): full profile and the same eleven lifecycle hooks under Codex #620 already made.)Co-Authored-By: Claude Sonnet 5 [email protected]
Claude-Session: https://claude.ai/code/session_01Cz7A6goxVzfKL9NT7k4zDH
🤖 Generated with Claude Code
https://claude.ai/code/session_01Cz7A6goxVzfKL9NT7k4zDH