Skip to content

refactor(crew-log): rename the append-only ledger to crew log (phase 1) - #11549

Merged
bolichen97 merged 1 commit into
mainfrom
refactor/crew-log-rename
Sep 18, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
refactor/crew-log-rename

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

The append-only per-unit log added by RFC #10090 was called "the ledger", and so is a great deal
else in this repo: the conductor work ledger and its session_ledger_read / session_ledger_record
tools, the ledger-sweep command, the ops-mission-control, auto-improvement and issue-radar
ledgers, and dependency_ledger.py. One word covered two unrelated mechanisms with different keys,
different lifetimes and opposite retention rules.

Reading session_ledger.py next to ledger/store.py gave no clue which was which, and a spec
sentence saying "the ledger" could not be resolved without checking the imports.

Why it matters

The cost lands on whoever reads this next. Grepping ledger returns both mechanisms and leaves you
to sort them by hand, and a reviewer cannot tell whether "the ledger is the authority a conductor
reads" is about the work ledger -- which is exactly the sentence a conductor acts on.

The two also invite real mistakes. The work ledger is keyed by SLOT KEY, which is recycled; this one
is keyed by the ACP session id, which is not. Their deletion rules are deliberately opposite: the
permanent-delete funnel removes this log and PRESERVES the work ledger. Naming them the same thing
makes that distinction something you have to remember rather than something you can read.

This is also the cheapest possible moment. The format is pre-release, KIROCREW_CREW_LOG is
default-off, and no user data exists on disk, so no shim, dual-read or migration is needed. After
the first release none of that is true.

What changed

The mechanism is named crew log, agreed with Joe Guo. Everything else called a ledger keeps its
name, and the old work ledger is untouched.

  • src/kiro_crew/ledger/ -> src/kiro_crew/crew_log/, and session_ledger_emit.py ->
    crew_log/emit.py.
  • crew_log/__init__.py re-exports its public names LAZILY (PEP 562). This is required by the move
    rather than a separate improvement: with the emitter inside the package, importing it would execute
    the package __init__ and pull in store, schema and lease, breaking the invariant that a
    flag-off launch imports no storage -- an invariant this suite asserts.
  • On disk: <data home>/crew-log/{crews,sessions}/<unit>/log.jsonl. The security/paths.py fence
    leaf moves in the SAME commit as the store leaf, because that fence is what keeps the agent's own
    file tools out of the store; splitting them would publish an unfenced store.
  • The RETIRED ledgers leaf STAYS in both fence sets (security/paths.py::_CREW_SECRET_LEAVES
    and sandbox.py::_CREW_HIDDEN_LEAVES). This rename ships no migration, so a machine that ran
    the old build with the flag on still has entries under <data home>/ledgers, and dropping the
    leaf would un-fence them from the agent's file tools and from a sandboxed open() on upgrade.
    It is deliberately NOT added to _CREW_PRECREATE_HIDDEN_DIR_LEAVES: that set exists for a root
    the store creates LAZILY, and nothing creates this one any more, so there is no writer to race
    and precreating it would only re-materialise the retired name on every machine.
  • The env flag is KIROCREW_CREW_LOG.
  • Docs: ledger-core.md -> crew-log-core.md, session-ledger-emitter.md ->
    crew-log-emitter.md, docs/reference/ledger/ -> docs/reference/crew-log/.
    rfc-append-only-ledger.md keeps its file name and title, because external links point at them,
    and gains one paragraph recording the name.
  • Tests: test_ledger_* -> test_crew_log_*, with every dotted monkeypatch path moved.

Unchanged on purpose: the header type vocabulary, every entry type name, all error codes including
no_ledger, LedgerError, SCHEMA_VERSION, the JSON field names, and the .lease / .lock file
names.

One behaviour was repaired rather than renamed.
test_a_neighbour_file_sharing_the_prefix_is_ignored_not_refused wrote a stray file named
ledger.backup.jsonl, but the segment prefix is now log., so the file no longer shared the prefix
the test is named for: segment_paths never saw it and the assertion held vacuously. It now writes
log.backup.jsonl.

Phase 2, to follow

Deliberately NOT in this PR, because three PRs are in flight over the same files
(#11185, #11310, and a projection change adding projection.py to the package):

  • the package's public identifiers: Ledger -> CrewLog, LedgerError -> CrewLogError,
    ledger_dir / ledger_root -> crew_log_dir / crew_log_root. ledger_dir alone has 63 call
    sites, which is why it is separated from the structural move.
  • the same rename applied to whatever those in-flight PRs add, including session_ledger_resolve.py
    and projection.py.

The error-code VALUE no_ledger stays frozen even when its class is renamed, and the work ledger
is never renamed
-- not in this PR and not in Phase 2.

Tests

flake8, black --check and isort --check-only clean on every changed Python file;
scripts/check_black_formatting.py, scripts/docs_lint.py and scripts/docs-lint.sh pass;
mypy --follow-imports=silent clean over crew_log plus the touched src files.

pytest -n 2 over every renamed test file plus test_acp_client.py, test_session_control.py,
test_steer_requeue.py, test_remove_slot_for_history_key.py and
test_sandbox_absent_ceiling_seal.py: green, with no excluded failures.

The repaired test was mutation-checked in both directions. With _segment_first_seq mutated to
accept a non-digit middle, the OLD filename still PASSED while the new one FAILED -- which is the
evidence that the fix restores the claim rather than just renaming a string. 1 killed / 1 total.

45 tests in the retention and types files failed earlier from #11193 and #11317 merging without ever
running CI together; #11445 fixed them and this branch is rebased onto it. Absorbing it needed one
adaptation worth knowing: #11445 adds from ledger_type_helpers import minimal_data, and this branch
renamed that helper, so the import named a module that no longer exists. The rebase itself was
conflict-free and every hunk landed, so nothing flagged it -- the module simply failed at collection.
The import now reads crew_log_type_helpers.

Pattern harvest

A rename that changes a filename constant can hollow out a test without failing it.
ledger.backup.jsonl stopped matching the log.*.jsonl glob, so the assertion passed for the wrong
reason: green, and testing nothing. A renamed test deserves the same question as a new one -- mutate
the code it guards and check it still goes red.

When a rename absorbs an in-flight change to the files it moved, a clean rebase proves less than it
appears to. Git paired the renames and every hunk arrived, yet the change was still broken, because
what it imported named the pre-rename module. A conflict check cannot see that and neither can
reading the diff; only running the tests catches it.

Substituting a phrase that carries its own article ("session ledger" -> "the session's log")
produces a the session's log wherever a determiner already stood. Prefer an article-free
replacement, then grep the result for doubled articles and doubled nouns before pushing.

@chenmingwei23
chenmingwei23 requested review from a team and smeyffret September 17, 2026 15:30
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 17, 2026
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 0882725b010edffece9944072db3b81538f9f247 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Retired KIROCREW_SESSION_LEDGER goes silently dead on upgrade for the same flag-on machines whose data the kept fence leaves protect — confirm, or warn once when set.

[DESIGN-REVIEWED] 0882725

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 0882725b010edffece9944072db3b81538f9f247 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0882725

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 0882725b010edffece9944072db3b81538f9f247: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 0882725b010edffece9944072db3b81538f9f247 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The PEP-562 lazy __init__ (~90 lines, a 60-name list kept in two places) exists only because the emitter moved inside the package — an unconsidered smaller shape avoids all of it.

Not justified as shipped

  • Item 2 — unjustified move: relocating the emitter to crew_log/emit.py is what forces the new __getattr__/_EXPORTS machinery — the description concedes it ("This is required by the move rather than a separate improvement") — yet the relocation's own harm is never named; on base the emitter was a top-level module and the eager __init__ satisfied the same flag-off boot-probe invariant (test_crew_log_emit.py::_BOOT_PROBE). The export list is now duplicated between _EXPORTS and the TYPE_CHECKING block with no parity pin (grep _EXPORTS in test/: 0 hits for this package).
    Subtraction: keep the emitter top-level as crew_log_emit.py, restore the plain eager __init__, and delete _EXPORTS, __getattr__ and __dir__.
    Clears when: the machinery is deleted per the subtraction, or a consumer is named that needs emit inside the package for something grouping does not cover.

What this change ships

Inventory (8 items) — 7 justified

Intent: rename the pre-release append-only per-unit ledger to "crew log" so it stops colliding with the work ledger and the repo's other ledgers — a FIX of a naming defect, agreed with a maintainer.

  1. The storage package is kiro_crew.crew_log; kiro_crew.ledger is gone — justified
  2. The emitter now lives inside the package, fronted by new lazy PEP-562 re-exports — unjustified move (forces new machinery; smaller top-level form unconsidered)
  3. Data lands under <home>/crew-log/…/log.jsonl instead of ledgers/…/ledger.jsonl — justified
  4. The enabling flag is KIROCREW_CREW_LOG; the old default-off spelling is inert — justified
  5. The retired ledgers directory stays fenced and hidden from the agent — justified
  6. A test's stray-neighbour filename repaired so its assertion tests something again, mutation-checked — justified
  7. Specs, reference docs and the RFC renamed/annotated in the same commit — justified
  8. Test files, fixtures and the type-helper module renamed; the rebase-broken import fixed — justified

[FIRST-PRINCIPLES-REVIEWED] 0882725

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 0882725b010edffece9944072db3b81538f9f247 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 0882725

Verdict parsed from the review's SHA-scoped output markers for commit 0882725b010edffece9944072db3b81538f9f247.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 0882725b010edffece9944072db3b81538f9f247: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 17, 2026
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- 🟡 CONCERNS

Which legitimate operations does 0882725b010edffece9944072db3b81538f9f247 newly refuse? Updated in place on each push. A script-confirmed regression blocks; the model proposes candidates and never decides a refusal.

Verdict basis: the reviewer's own judgement; no confirmed regression.

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 10 classified, 0 newly refused, 10 still allowed.
  • ubuntu-latest (platform posix): 10 classified, 0 newly refused, 10 still allowed.
  • windows-latest (platform windows): 5 classified, 0 newly refused, 5 still allowed.

No candidate flipped from allowed to refused.

Scope-Verdict: CONCERNS

TIGHTENING: The file-tool path fence (_CREW_SECRET_LEAVES in src/kiro_crew/security/paths.py, expanded into _SENSITIVE_HOME_DIRS under ~/.kiro/crew and ~/.kirocrew and enforced by the adjudicated sensitive_path_refusal tier) gains the new leaf + "crew-log", while keeping the retired "ledgers" leaf -- the ONE threat it refuses is an agent's auto-approved file tools reaching the renamed append-only store root, which "would let it forge an entry attributed to the gateway, or rewrite the history it is supposed to be reporting into, which is the one thing an append-only record exists to prevent". The same leaf is added to the OS-sandbox mask (_CREW_HIDDEN_LEAVES in sandbox.py: + "crew-log",), and _CREW_PRECREATE_HIDDEN_DIR_LEAVES swaps -"ledgers" for +"crew-log", so only the new root is pre-materialized at 0700 before the store's first lazy write.

ADJUDICATED: 15 candidates, 0 confirmed newly-refused
No confirmed regressions were handed to this run. The fence entry is home-anchored (<home-prefix>/crew-log, matched by equality or startswith(target + os.sep) on resolved, casefolded forms), not a basename rule, so the expected adjudicated result is zero flips; the candidates probe exactly the boundaries where that expectation would fail -- the leaf's parent and sibling under the crew home (rows for ls -la ~/.kiro/crew, cat ~/.kiro/crew/config.json, and the bare-path title ~/.kiro/crew/config.json that a claude-agent-acp file read presents to this exact tier), and the workspace paths this same PR creates whose basename equals the new leaf (docs/reference/crew-log/, src/kiro_crew/crew_log/, the renamed test_crew_log_*.py suites, and the renamed KIROCREW_CREW_LOG flag in command text).

PLATFORM COVERAGE: posix (9 rows) and windows (6 rows); no any rows, since every candidate carries a path. The diff's one platform assumption is that leaf specs are authored with POSIX / and re-joined per host (_LEAF_SEPARATOR / os.path.join), so the windows rows probe the re-joined spelling from both directions: the fenced leaf's sibling under a drive-anchored home (%USERPROFILE%\.kiro\crew\config.json, Get-ChildItem -Path $env:USERPROFILE\.kiro\crew) and the workspace crew-log segment under backslash separators (Get-ChildItem -Path docs\reference\crew-log, the bare title docs\reference\crew-log\README.md, and the .venv\Scripts\python.exe test run). macOS is covered by the posix spellings for the adjudicated fence; its Seatbelt half of the sandbox mask is named below, because no leg adjudicates it. The per-leg verdicts are the deterministic fold's to report, not mine.

UNADJUDICATED: Two guards in this tightening never reach the shell-command classifier, so no verdict exists for them and this review does not claim one:

  1. The OS-sandbox hidden mask (sandbox.py). Call path: agent shell spawn -> the sandbox launcher walks the hidden-leaf table and masks <crew home>/<leaf> for each name present (an isdir-guarded loop, with _CREW_PRECREATE_HIDDEN_DIR_LEAVES materializing lazily-created roots at 0700 first; bind-mask on Linux, Seatbelt deny on macOS) -> a sandboxed subprocess's open() of <home>/crew-log/... is refused at OS level. Candidate legitimate inputs I would have submitted: an in-sandbox read of <home>/crew-log (the design states nothing in-sandbox reads one -- the store runs in the gateway process -- so expected loss is zero); an in-sandbox read of the retired <home>/ledgers on an upgraded machine (already hidden at base, so no flip); and a fresh machine, where the retired name is deliberately no longer precreated -- nothing creates it any more, so no reader loses anything, but the retired root's mask now holds only where the directory already exists.
  2. The boot-path root validator (_ensure_ledger_root in config/paths.py), which now asserts owner-only mode and symlink containment for <home>/crew-log and its crews/sessions kind directories instead of <home>/ledgers. It fails soft with a warning and gates no agent input, but the retired root's mode is no longer asserted at boot; no input reaches it through the tool gate, so nothing could be submitted for a verdict.

[SCOPE-REVIEWED] 0882725

@chenmingwei23
chenmingwei23 force-pushed the refactor/crew-log-rename branch from b8a9553 to 8404a83 Compare September 17, 2026 15:57
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 17, 2026
@chenmingwei23
chenmingwei23 force-pushed the refactor/crew-log-rename branch 3 times, most recently from 4aff8fb to 4aa561e Compare September 17, 2026 17:49
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Three red shards on 4aa561eb47, and none of them is this PR's. Splitting them by what I can prove.

Backend Tests (Windows) (7) and macOS Tests / Backend Tests (macOS) (3) = #11563, main-owned.

Both fail the same four tests, which are the ones #11563 tracks:

test/test_session_control.py::test_private_creator_cannot_change_memory[writer-canonical]
test/test_session_control.py::test_private_creator_cannot_change_memory[public-worker-canonical]
test/test_session_control.py::test_create_refuses_unreadable_delegation_identity[ValueError]
test/test_session_control.py::test_create_refuses_unreadable_delegation_identity[OSError]

Windows shard 7 reports 4 failed, 13148 passed. Reproduced on a detached origin/main checkout at
0640c1e0d5 with no other changes in the tree: same four names, same assertions, 4 failed, 4 passed.
They arrived with #11438. This PR's only edit to that file is the env-flag rename and the two import
lines, so it cannot reach the delegation logic those tests exercise.

macOS Tests / Backend Tests (macOS) (2) is a separate failure I cannot attribute.

Eleven failures, in seven files this PR's diff does not touch at all:

test/test_pid_lifecycle.py::TestSyncKillProviderTree  (6 tests)
test/test_member_session_control.py::TestMemberChildPrivateBinding  (2 tests)
test/test_git_worktree_scope.py::test_surrogate_decoded_non_utf8_gitdir_finds_the_existing_config
test/test_governance_updates.py::TestRepoExecConfigRefusal::test_probe_hands_a_non_utf8_git_dir_to_the_classifier_round_trippable
test/test_md_notebook.py::test_run_git_surrogateescape_round_trips_a_non_utf8_path

macOS shard 3 also carries two more of the same non-UTF8-path kind
(test_project_git_status_log.py::TestWorktreeConfigScopeGate::test_oversized_config_worktree_in_a_non_utf8_repo_path_stays_refused
and test_worktree_create.py::TestLauncherAdvisoryIsNotARefusal::test_probe_finds_config_worktree_behind_a_non_utf8_path),
beyond the four above.

I am not claiming these are main-owned, because I have not proved it: they are macOS-only and I cannot
reproduce them on Linux. What is verifiable from here is that none of those seven files appears in this
PR's diff, and that this is the first head on which these three shards have run to completion -- on the
previous head all three were cancelled by supersession rather than finishing, so there is no earlier
result to compare against.

The TestMemberChildPrivateBinding pair sits in the same private-member-binding area as #11438 and
#11018, both of which landed on main shortly before this run, so they may belong with #11563. The
non-UTF8-path and pid_lifecycle groups look environmental. Someone on macOS can settle both quickly by
running those files at 0640c1e0d5.

No new head is being pushed for any of this: the four review lanes (GPT 5.6, Opus 4.8, Design, First
Principles) are green on 4aa561eb47, and a push would re-roll all of them without touching a single
one of these failures.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Correcting my comment above, and adding the fourth red.

Backend Tests (Windows) (5) is now red too, with 2 failed, 13212 passed, and it fails only this
pair:

test/test_member_session_control.py::TestMemberChildPrivateBinding::test_a_v1_child_writes_no_private_binding
test/test_member_session_control.py::TestMemberChildPrivateBinding::test_global_caller_cannot_grant_a_child_private_authority

That pair is NOT macOS-only, so my "cannot reproduce on Linux" above was wrong for it. Its appearance
on Windows is what showed me it is platform-independent, which made it testable here after all. Measured
on both sides:

tree result
origin/main at 419d9d7b90 2 failed, 8 passed -- assert 'member-radar' is None
this branch at 4aa561eb47 2 failed, 8 passed -- same two names, same assertion

So it is main-owned, and I have recorded it on #11563 with the reproduction. Candidate cause there is
#11018 rather than #11438, since the assertion is about a private binding being written where none
should be.

The rest of my earlier comment stands. The non-UTF8-path failures and the six
test_pid_lifecycle.py::TestSyncKillProviderTree failures appear ONLY on the macOS shards -- neither
Windows shard carries them -- so for those the macOS-only description was right and they remain
unattributed pending someone with a macOS host.

Current tally of red shards on 4aa561eb47, all four main-owned or outside this diff:

Still no new head: GPT 5.6, Opus 4.8, Design Review and First Principles are all green on
4aa561eb47, and none of these failures is reachable from this diff.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 17, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 17, 2026
The append-only per-unit log mechanism is named crew log. Every other thing
in the repo called a ledger keeps its name, including the work ledger, the
session_ledger_read/record tools, ledger-sweep, and the app ledgers.

The package src/kiro_crew/ledger/ becomes src/kiro_crew/crew_log/, and
session_ledger_emit.py moves in as crew_log/emit.py. Moving the emitter into
the package would make importing it execute the package __init__ and pull in
store, schema and lease, so __init__ re-exports lazily (PEP 562) and the
flag-off boot path still imports no storage.

On disk the leaf is <data home>/crew-log/{crews,sessions}/<unit>/log.jsonl.
The security/paths.py fence leaf moves in the same commit as the store leaf,
because that fence is what keeps agent file tools out of the store. The env
flag is KIROCREW_CREW_LOG. No shim, no dual-read, no migration: the flag is
default-off and no user data exists on disk.

The reference pages, the two module specs and the renamed test files follow
the same name. rfc-append-only-ledger.md keeps its file name and title for
external links and gains one paragraph recording the name.

A stray-file test regained its teeth: it wrote ledger.backup.jsonl, which no
longer shares the segment prefix, so segment_paths never saw it and the
assertion held vacuously. It now writes log.backup.jsonl.

The test-writer fixes from #11445 land on files this rename moved, and its
new helper import names the pre-rename module, so the retention test reads
it from crew_log_type_helpers instead.
@chenmingwei23
chenmingwei23 force-pushed the refactor/crew-log-rename branch from 4aa561e to 0882725 Compare September 17, 2026 22:03
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention labels Sep 17, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

macOS Tests / Backend Tests (macOS) (3) is red on 0882725b01 for a new reason, unrelated to
anything above: 12 failures, all in test/test_xdist_host_budget.py, 12 failed, 36641 passed.

Every assertion is a worker-count number the host is expected to yield:

test_alone_gets_the_whole_machine            assert 2 == 10
test_the_xdist_env_var_is_honoured_as_a_ceiling  assert 2 == 4
test_second_run_takes_what_is_left           assert 1 == 3
test_memory_binds_before_cores               assert 1 == (8 // 3)

Not this PR's, on three independent grounds. The file has zero lines in this diff, it contains no
reference to anything the rename touched, and the whole file passes 55 passed on Linux.

It is macOS-specific, and the mocking is what makes that interesting: the tests monkeypatch
os.cpu_count to 10 and _host_total_gib to 32, so resolve_workers() == 10 should be
deterministic. On the macOS runner it resolves 2 anyway, which means a macOS path reads a real host
value the test does not mock. test_xdist_host_budget.py was last changed by #10840
(fix(tests): platform-aware per-worker memory reservation for -n auto budget), which is exactly
that platform-aware reading, and that commit is in this branch's base unmodified.

One thing this run does settle: #11566 and #11491 worked. The non-UTF-8-path group and
test_pid_lifecycle.py::TestSyncKillProviderTree are absent from this shard's failures, where both
appeared before those two landed. That confirms the macOS-only attribution for both groups, which
earlier I could only assert from platform coverage rather than prove.

No new head for any of this. GPT 5.6, Opus 4.8, Design Review and First Principles are all green on
0882725b01.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 17, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 17, 2026
@bolichen97
bolichen97 merged commit 03e24a7 into main Sep 18, 2026
132 of 134 checks passed
@bolichen97
bolichen97 deleted the refactor/crew-log-rename branch September 18, 2026 00:29
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 18, 2026
chenmingwei23 added a commit that referenced this pull request Sep 18, 2026
The crew log is fenced from the agent so a session cannot alter its own audit
trail. That stays. What it also did was make the log unverifiable by anyone but
the operator with a shell, because reading was fenced along with writing.

This adds a standalone, assignable, read-only MCP server of three tools over the
gateway's own routes: list the session logs, page one, read a fold. No write tool
exists and the set is ratcheted so none can be added. Authorization lives in the
endpoints: the caller's own unit needs a strict session identity, and any wider
read needs the owner at a dashboard tab.

Refs #11549
chenmingwei23 added a commit that referenced this pull request Sep 18, 2026
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.
chenmingwei23 added a commit that referenced this pull request Sep 18, 2026
The crew log is fenced from the agent so a session cannot alter its own audit
trail. That stays. What it also did was make the log unverifiable by anyone but
the operator with a shell, because reading was fenced along with writing.

This adds a standalone, assignable, read-only MCP server of three tools over the
gateway's own routes: list the session logs, page one, read a fold. No write tool
exists and the set is ratcheted so none can be added. Authorization lives in the
endpoints: the caller's own unit needs a strict session identity, and any wider
read needs the owner at a dashboard tab.

Refs #11549
chenmingwei23 added a commit that referenced this pull request Sep 19, 2026
The crew log is fenced from the agent so a session cannot alter its own audit
trail. That stays. What it also did was make the log unverifiable by anyone but
the operator with a shell, because reading was fenced along with writing.

This adds a standalone, assignable, read-only MCP server of three tools over the
gateway's own routes: list the session logs, page one, read a fold. No write tool
exists and the set is ratcheted so none can be added. Authorization lives in the
endpoints: the caller's own unit needs a strict session identity, and any wider
read needs the owner at a dashboard tab.

Refs #11549
chenmingwei23 added a commit that referenced this pull request Sep 19, 2026
The crew log is fenced from the agent so a session cannot alter its own audit
trail. That stays. What it also did was make the log unverifiable by anyone but
the operator with a shell, because reading was fenced along with writing.

This adds a standalone, assignable, read-only MCP server of three tools over the
gateway's own routes: list the session logs, page one, read a fold. No write tool
exists and the set is ratcheted so none can be added. Authorization lives in the
endpoints: the caller's own unit needs a strict session identity, and any wider
read needs the owner at a dashboard tab.

Refs #11549
chenmingwei23 added a commit that referenced this pull request Sep 19, 2026
The crew log is fenced from the agent so a session cannot alter its own audit
trail. That stays. What it also did was make the log unverifiable by anyone but
the operator with a shell, because reading was fenced along with writing.

This adds a standalone, assignable, read-only MCP server of three tools over the
gateway's own routes: list the session logs, page one, read a fold. No write tool
exists and the set is ratcheted so none can be added. Authorization lives in the
endpoints: the caller's own unit needs a strict session identity, and any wider
read needs the owner at a dashboard tab.

Refs #11549
bolichen97 pushed a commit that referenced this pull request Sep 19, 2026
…#11907)

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.
chenmingwei23 added a commit that referenced this pull request Sep 19, 2026
The crew log is fenced from the agent so a session cannot alter its own audit
trail. That stays. What it also did was make the log unverifiable by anyone but
the operator with a shell, because reading was fenced along with writing.

This adds a standalone, assignable, read-only MCP server of three tools over the
gateway's own routes: list the session logs, page one, read a fold. No write tool
exists and the set is ratcheted so none can be added. Authorization lives in the
endpoints: the caller's own unit needs a strict session identity, and any wider
read needs the owner at a dashboard tab.

Refs #11549
iamwhatever pushed a commit that referenced this pull request Sep 19, 2026
…log (#11909)

The crew log is fenced from the agent so a session cannot alter its own audit
trail. That stays. What it also did was make the log unverifiable by anyone but
the operator with a shell, because reading was fenced along with writing.

This adds a standalone, assignable, read-only MCP server of three tools over the
gateway's own routes: list the session logs, page one, read a fold. No write tool
exists and the set is ratcheted so none can be added. Authorization lives in the
endpoints: the caller's own unit needs a strict session identity, and any wider
read needs the owner at a dashboard tab.

Refs #11549
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…tdev#11549)

The append-only per-unit log mechanism is named crew log. Every other thing
in the repo called a ledger keeps its name, including the work ledger, the
session_ledger_read/record tools, ledger-sweep, and the app ledgers.

The package src/kiro_crew/ledger/ becomes src/kiro_crew/crew_log/, and
session_ledger_emit.py moves in as crew_log/emit.py. Moving the emitter into
the package would make importing it execute the package __init__ and pull in
store, schema and lease, so __init__ re-exports lazily (PEP 562) and the
flag-off boot path still imports no storage.

On disk the leaf is <data home>/crew-log/{crews,sessions}/<unit>/log.jsonl.
The security/paths.py fence leaf moves in the same commit as the store leaf,
because that fence is what keeps agent file tools out of the store. The env
flag is KIROCREW_CREW_LOG. No shim, no dual-read, no migration: the flag is
default-off and no user data exists on disk.

The reference pages, the two module specs and the renamed test files follow
the same name. rfc-append-only-ledger.md keeps its file name and title for
external links and gains one paragraph recording the name.

A stray-file test regained its teeth: it wrote ledger.backup.jsonl, which no
longer shares the segment prefix, so segment_paths never saw it and the
assertion held vacuously. It now writes log.backup.jsonl.

The test-writer fixes from kirodotdev#11445 land on files this rename moved, and its
new helper import names the pre-rename module, so the retention test reads
it from crew_log_type_helpers instead.
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…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.
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…log (kirodotdev#11909)

The crew log is fenced from the agent so a session cannot alter its own audit
trail. That stays. What it also did was make the log unverifiable by anyone but
the operator with a shell, because reading was fenced along with writing.

This adds a standalone, assignable, read-only MCP server of three tools over the
gateway's own routes: list the session logs, page one, read a fold. No write tool
exists and the set is ratcheted so none can be added. Authorization lives in the
endpoints: the caller's own unit needs a strict session identity, and any wider
read needs the owner at a dashboard tab.

Refs kirodotdev#11549
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.

2 participants