Repository navigation
refactor(crew-log): rename the store's ledger identifiers to crew log - #11907
Conversation
|
Intent: make this store's identifiers say crew log, the name Phase 1 (#11549) already gave its package, its directory and its docs, so that reading a name tells you which of the four ledgers in this repository it means. Not a goal: changing any behaviour, any on-disk name, any wire value or any error code; renaming the session work ledger, the taskq wait ledger or the builtin apps' accounting ledgers; sweeping free-standing inline comments in the three files that host several of those ledgers. |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify no out-of-tree consumers import [DESIGN-REVIEWED] ecde316 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify no out-of-repo consumer imports What this change shipsInventory (6 items) — 6 justifiedIntent: finish Phase 1's crew-log rename (#11549) so the store's identifiers stop colliding with the repo's four other "ledger" mechanisms — a FIX for a name ambiguity with a recorded prior step (the package/directory already say
I verified: zero old-name stragglers remain in [FIRST-PRINCIPLES-REVIEWED] ecde316 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Phase 1 (#11549) renamed the package, the paths and the user-facing text. The identifiers stayed, so the code still said ledger for a mechanism the docs and the disk now call the crew log -- while three other live mechanisms are also called a ledger. Renames, behaviour unchanged: LedgerError -> CrewLogError, class Ledger -> CrewLog, ledger_root/ledger_dir/ledger_path -> crew_log_*, and the caller-side helpers and locals that name this store. The work ledger, the accounting ledgers and every frozen wire value keep their names.
6168c35 to
ecde316
Compare
Red classification on
|
Disposition: the no-alias question from Design and First Principles, and a correction to my own descriptionBoth lanes PASS on The question is well-formed rather than spurious, and worth saying so first. On the base commit these really are exported names, not private ones: Three facts answer it. No released artifact has ever exposed the import path. Of the 79 The path is 25 hours old. The aliasing decision was already made at Phase 1 and merged. That commit deleted In-repo coverage is already on the record: the First Principles lane ran its own sweep and reports zero old-name stragglers across Correction to the descriptionFirst Principles is right that the arithmetic in the body is off, and the specific number is worth stating. The body says "1036 lines change and 1033 lines change back, and the three extra lines are one new test". That was true of the first head, The substance the sentence was making -- that the only behavioural line in the diff is the one new I am leaving the body as it stands rather than editing it, and the reason is mechanical: |
bolichen97
left a comment
There was a problem hiding this comment.
Approved after verification: PR Readiness success on this head, no active change requests or unresolved threads, mergeable against current main.
…kirodotdev#11907) Phase 1 (kirodotdev#11549) renamed the package, the paths and the user-facing text. The identifiers stayed, so the code still said ledger for a mechanism the docs and the disk now call the crew log -- while three other live mechanisms are also called a ledger. Renames, behaviour unchanged: LedgerError -> CrewLogError, class Ledger -> CrewLog, ledger_root/ledger_dir/ledger_path -> crew_log_*, and the caller-side helpers and locals that name this store. The work ledger, the accounting ledgers and every frozen wire value keep their names.
Problem / Motivation
Four different things in this repository are called a ledger. Reading a name does not tell you which one.
Phase 1 (#11549) renamed this store's package, its directory on disk and every doc that describes it to crew log. The identifiers stayed behind. So
LedgerErrorin a traceback,ledger_dir()in a review diff and a thread namedmc-ledgerin a stack dump each still name the crew log, while the session work ledger (session_ledger.py), the taskq wait ledger (WaitLedger) and two builtin apps' accounting ledgers answer to the same word.Why it matters
A reader has to open the file to learn which ledger a name means. That is not hypothetical: the Phase 1 prose sweep renamed nine comments that named OTHER ledgers, every one of them had to be reverted, and one of them had un-fenced the work ledger's directory from the sandbox mask.
What changed (motivation → approach → change)
The store's own vocabulary now matches the name on its package and on disk. Nothing else moves: 1036 lines change and 1033 lines change back, and the three extra lines are one new test.
LedgerErrorCrewLogErrorclass Ledgerclass CrewLogledger_root/ledger_dir/ledger_pathcrew_log_root/crew_log_dir/crew_log_pathledger_executor,_MAX_LEDGER_WORKERS, thread prefixmc-ledgerinsrc/kiro_crew/executors.pycrew_log_executor,_MAX_CREW_LOG_WORKERS,mc-crewlog_ensure_ledger_rootinsrc/kiro_crew/config/paths.py,_cleanup_expired_ledgersinsrc/kiro_crew/history.py_ensure_crew_log_root,_cleanup_expired_crew_logs_session_ledger_draininsrc/kiro_crew/dashboard/server.py,_remove_session_ledgerinsrc/kiro_crew/dashboard/handlers/sessions.py_crew_log_drain,_remove_session_crew_log_ledger_model/_ledger_lineage/_ledger_sid/_ledger_turn_noand siblings insrc/kiro_crew/dashboard/chat_runner.py_crew_log_*ledger_kindinsrc/kiro_crew/llm_helpers.pyand its callerssrc/kiro_crew/dashboard/chat_title.py,src/kiro_crew/dashboard/chat_summary.py,src/kiro_crew/history_consolidation.py;ledger_sidinsrc/kiro_crew/session_lifecycle.pycrew_log_kind,crew_log_sid_ledger_enabledinsrc/kiro_crew/acp/_dispatch.py;_ledger()and_MAX_OPEN_LEDGERSinsrc/kiro_crew/crew_log/emit.py_crew_log_enabled,_crew_log(),_MAX_OPEN_CREW_LOGS"session ledger: "insrc/kiro_crew/subagent_manager/admission/gate.py,src/kiro_crew/subagent_manager/continuation.py,src/kiro_crew/subagent_manager/terminal.py"crew log: "docs/reference/crew-log/, the threecrew-log-*specsFour names are deliberately kept, because each is a different mechanism or a frozen value:
CODE_NO_LEDGERand its value"no_ledger"errors.pystates codes are additive-only and never renamedsession_ledger,work_ledger,ledger_sweep,WaitLedger, the app ledgersSCHEMA_VERSION, entry-type names, header fields,.lease/.lockdocs/request-for-change/rfc-append-only-ledger.mdRenaming an identifier was done by rewriting NAME tokens only, so no string, comment or docstring could be hit by accident, and the prose was then judged one site at a time. One comment survives on purpose:
test_crew_log_emit.pysays "injected ledger context" about the WORK ledger's snapshot, which is a different mechanism in a crew-log file.Free-standing inline comments in
chat_runner.py,slack/gateway.pyandsubagent_manager/are left alone. Those files host three of the four ledgers, and a sweep there is what went wrong in Phase 1; docstrings, which belong to a named function, were safe to do.Backwards compatibility
Breaking: every renamed identifier above. No wire value, config key, route, on-disk name or entry type changes, so no stored crew log and no reader of one is affected. Writer sweep on origin/main @
1ae8f6ee48: every reference to every renamed symbol acrosssrc,test,docsandscriptsis in this diff. The one match outside it,builtin_skills/kirocrew-dev/prepare-pr/references/rationale.md, is a sentence about a 2026 incident naming the pre-Phase-1 filenametest/test_ledger_kinds.py, not a use of any symbol.One observable string changes: the crew-log writer pool's threads are now named
mc-crewlog. Nothing read that name, andtest_executors.pynow pins it the way it already pinsmc-maint,mc-subprocandmc-cron.Tests
test/test_executors.py::test_thread_name_prefixes_distinguish_poolsgains one assertion, pinning the crew-log pool's thread prefix so the rename is a stated contract rather than a silent change. That is the only behavioural line in the diff.One test names a renamed identifier as a STRING rather than importing it:
test/test_chat_runner_early_recovery_actor.pyAST-parseschat_runner.pyand asserts the turn actor is bound before anytrythat queues a recovery, so the name it looks for moves with the local.Every other test is renamed, not rewritten. 2077 tests pass locally across the crew-log suite, the dashboard callers and, and as the regression check that they were not touched,
test_session_ledger.py,test_work_ledger.pyandtest_ledger_sweep.py.Gates green on the final head: isort, flake8,
scripts/check_black_formatting.py,scripts/check_subprocess_encoding.py,scripts/docs_lint.py, and mypy on the 25 source files it reaches (its two remaining errors are pre-existing boto3-stub drift intranscribe.py, which this diff does not touch).Manual verification
N/A. A rename with no behaviour change, and the one observable string is pinned by a test.
Related Issues
Refs #11549