Skip to content

fix(ledger): make the test writers satisfy the entry registry - #11445

Merged
iamwhatever merged 1 commit into
kirodotdev:mainfrom
chenmingwei23:fix/ledger-registry-required-fields
Sep 17, 2026
Merged

iamwhatever merged 1 commit into
kirodotdev:mainfrom
chenmingwei23:fix/ledger-registry-required-fields

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

What is the problem?

Backend Tests are red on main and on every open PR. The four ledger test files fail 12+ tests with LedgerError: data.agent: is required and absent (and data.actor, data.name, data.depth variants). The failures come from two ledger PRs that merged 50 minutes apart and were never run together: #11193 (e65ec3ece) added the retention sweep and the session/closed teardown marker, and #11317 (039d3e83d7) added src/kiro_crew/ledger/entry_types.py, which declares the required fields of each session entry type and validates data on every append. main's own CI never completed a run for the merge that first combined them -- each new push cancels the previous run -- so nobody saw the break.

Why it matters

A red Backend Tests lane blocks the merge queue for everyone. Until it clears, no PR that touches this repository can land, whatever its own content, because the required check is failing on a base condition none of those PRs introduced.

What changed

How the fix solves it -- symptom to root cause

The data.agent/data.actor/data.name refusals all trace to the same cause: the retention and kinds test files hand-write entry payloads by hand, and #11317's registry now refuses a payload that omits a required field. The production emitters are correct -- session_ledger_emit.on_session_opened writes all six required session/opened fields, and on_session_closed writes the required reason -- so the fix is confined to the test writers, which is where the two designs actually disagree.

  • session/opened writers that named only {"resumed": ...} now carry every required header field. A small _opened(resumed=...) builder in test_ledger_retention.py fills the rest from ledger_type_helpers.minimal_data, so the fixtures stay one line each and never hold a payload the format refuses. The one emitter-independent site in test_remove_slot_for_history_key.py spells the full valid payload inline.
  • turn/started gains its required actor and depth; tool/completed gains its required name and server.
  • Two retention tests deliberately plant a session/closed line the append path must refuse -- one with no reason, one with a non-string reason -- to prove the sweep's own reader rejects them. Those go through a valid append and then overwrite the on-disk data via a new plant= argument on the existing _append_at helper, so the line keeps a well-formed envelope while carrying the malformed payload the reader test needs.

Tests

What tests we did

Isolated KIROCREW_HOME, -n 2, on the fix branch off origin/main 04727ebe0f:

  • The four brief files -- test_ledger_retention.py, test_ledger_kinds.py, test_remove_slot_for_history_key.py, test_ledger_core.py: 423 passed (was 46 failed / 377 passed before the fix).
  • test_ledger_types.py, test_session_ledger_emit.py, test_docs_ledger_reference.py: 540 passed, 1 failed. The single failure -- test_a_crew_append_is_untouched_by_the_registry, LedgerError: entry type domain must be a plain name or app:<name>: 'crew:qa/report', CODE_BAD_TYPE from schema.py:247 -- reproduces byte-identically on a clean detached checkout of origin/main. It is a separate, pre-existing break in the guest-namespace type check, not a data-field refusal, and is out of scope for this fix.
  • flake8 and black --check clean on all three touched files. mypy --follow-imports=silent reports only the test suite's established monkeypatching errors (method assignment, attribute-on-callable); none reference the changed lines.

Any other suggestions

The guest-type failure above (crew:qa/report refused as a bad type) warrants its own investigation -- it looks like a second, independent regression in the same window.

Pattern harvest

Rule candidate: when two open PRs touch one contract (a writer and its validator), run their branches together on CI or land them in one merge window before merging either -- a required lane on main was red for 50 minutes because #11193 and #11317 were only ever tested apart.

Two PRs that both touch one contract -- here the ledger's entry shape, split across the writer (#11193) and the validator (#11317) -- must be run together before the second merges. The break was invisible because main's CI is cancel-superseded, so the merge that first combined the two designs never produced a verdict. Either re-run the second PR's full suite against a base that already contains the first, or stop main's CI from cancel-superseding itself so a red on the combined tree is observed on main rather than inherited by the next unrelated PR.

@chenmingwei23
chenmingwei23 requested review from a team and krishdhasmana September 17, 2026 03:01
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running 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

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed 14086726d563536d40ca0d833a26f5fdd1d7d487 via the fork AI-review pipeline; updated in place on each push.

Review details

FINDING -- test/test_ledger_types.py:480 -- "crew/report" also repairs the explicitly out-of-scope guest-namespace failure -> Fix: remove this hunk and address it separately.
[GPT-REVIEWED] 1408672

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed 14086726d563536d40ca0d833a26f5fdd1d7d487 via the fork AI-review pipeline; updated in place on each push.

Review details

I've verified the diff against the base files and the production validation logic:

  • The base already carries turn/started with actor/depth (line 489), so the REOPENED test's unchanged context is consistent with validate_data.
  • session/closed.reason has enum=("reset",) with enum_closed=False, so it is a required string but the vocabulary is not enforced — the appends of {"reason": "destroyed"} and {"reason": "reset"} are both valid, and the plant= path lands the malformed payload the reader tests read.
  • tool/completed now requires name/server; the diff supplies them. session/opened fixtures supply all six required header fields. crew-kind types are undeclared, so validate_data returns early.

No test edit silently defeats the invariant it names. The candidate file lists no candidates, and Step 2 turned up nothing grounded to the 80+ bar.

No findings.

[OPUS-REVIEWED] 1408672

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🟡 CONCERNS

Design-level review of 14086726d563536d40ca0d833a26f5fdd1d7d487 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Description says the crew:qa/report failure is "out of scope" and "warrants its own investigation," yet the diff rewrites that exact test.

Watch

  • The description states the test_a_crew_append_is_untouched_by_the_registry failure "is a separate, pre-existing break … out of scope for this fix," but the diff changes that test (crew:qa/report → crew/report + ref). A reviewer merging on the description won't scrutinize this hunk, and the description simultaneously calls the underlying behavior "a second, independent regression" while the code silently accepts it as correct. The rewrite is in fact right — crew:qa/report is pinned as malformed by test_ledger_kinds.py:154 and test_ledger_core.py:602, so the old test was the stale side of the conflicting merge — but the PR must say so, not disown the change.
    Clears when: the description is updated to state the crew-test rewrite is included and that the refusal is the pinned design (citing the two base tests), retracting the "independent regression" framing.

[DESIGN-REVIEWED] 1408672

@didhd didhd mentioned this pull request Sep 17, 2026
5 tasks done
didhd added a commit to didhd/KiroCrew that referenced this pull request Sep 17, 2026
Give macOS Cmd+W to the native Window menu and use Option+Shift+W
for session close. Preserve hide-to-tray for the main window. Confirm
every secondary close before renderer teardown: unload probes can
discard unsaved work when a renderer accepts or times out. Keep browser
pages and their control owners alive until the user confirms closing.

Include the Fargate protocol repair from PR kirodotdev#11422 and the ledger test
fixture repair from PR kirodotdev#11445 so inherited backend CI failures do not
hide regressions in this change. Correct the remaining crew event
fixture to use its valid type without changing production validation.

Co-authored-by: Stan Tian <273962421+pepmach@users.noreply.github.com>
Co-authored-by: Raymond Chen <45910466+chenmingwei23@users.noreply.github.com>
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 17, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Attribution of this PR's red board, from run 35178868292. None of the four is this
PR's own code, and there are ZERO ledger failures -- the break this PR exists to fix
is gone on this head.

Backend Tests (3.12, 3) / (Windows) (3)
  test/test_fargate_launch_engine.py::test_engine_satisfies_the_launch_engine_protocol
    AssertionError: begin_signin: ['instance_id','profile','region']
                               != ['instance_id','profile','region','login_target']
  test/test_fargate_launch_engine.py::test_signin_handle_has_every_signin_handle_protocol_member
    AssertionError: ... Right contains one more item: 'error'
  -> the separate Fargate break from #11230, fixed by #11432

  test/test_pid_lifecycle.py::TestSyncKillProviderTree::
    test_reaped_leader_does_not_suppress_the_group_signal
  -> one observation only, and this PR touches nothing outside ledger test files.
     A re-run is needed to tell a flake from a real failure; I am not calling it
     either on a single sample.

E2E (stub ACP backend, offline)
  test/e2e/test_private_workflow_memory.py -> RuntimeError: memory_unavailable
  -> the already-known intermittent E2E lane

Coverage Gate
  "backend-test=failure -- failing closed"
  -> the cascade of the above, not an independent finding

Merge order, measured on both heads rather than assumed: this PR and #11432 block each
other, because each one's red board is the other one's fix.

this PR    zero ledger failures; reds are the Fargate pair
#11432     zero Fargate failures; all 12 reds are test_ledger_* + test_remove_slot_*

So neither can reach a green board alone. Landing either one makes the other's board
clear on a re-run without a push.

@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
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Sep 17, 2026
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Sep 17, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Re-run concluded on the same head (1408672, no push). The board went from four reds
to ONE, and the one that remains is not this PR's:

83 lanes = 71 success + 10 skipped + 1 neutral + 1 failure   (sum checks)

Backend Tests (Windows) (3)   the only red, and it is exactly two assertions:
  test/test_fargate_launch_engine.py::test_engine_satisfies_the_launch_engine_protocol
    begin_signin: ['instance_id','profile','region']
               != ['instance_id','profile','region','login_target']
  test/test_fargate_launch_engine.py::test_signin_handle_has_every_signin_handle_protocol_member
    Right contains one more item: 'error'

Everything else I attributed earlier cleared on the re-run, so those were flakes rather
than findings:

test_pid_lifecycle.py::test_reaped_leader_does_not_suppress_the_group_signal
  0 hits in the re-run -- fail then pass on the SAME head, so flake, not a break.
  I am not filing it.
E2E (stub ACP backend, offline)   passed
Coverage Gate                     passed, which confirms it was only the cascade
Backend Tests (3.12, 3)           passed

So this PR now has ZERO ledger failures and ZERO failures of its own. Its single red is
break C from #11230, which #11432 fixes -- and #11432's twelve reds are all
test_ledger_* / test_remove_slot_*, which this PR fixes.

Landing either one turns the other fully green on a re-run with no push. This head is
the cleanest demonstration of that: one red lane, two assertions, both in a file this
PR does not touch.

@iamwhatever
iamwhatever merged commit cdd4f13 into kirodotdev:main Sep 17, 2026
123 of 129 checks passed
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 17, 2026
chenmingwei23 added a commit to chenmingwei23/KiroCrew that referenced this pull request 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 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.
chenmingwei23 added a commit to chenmingwei23/KiroCrew that referenced this pull request 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 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.
chenmingwei23 added a commit to chenmingwei23/KiroCrew that referenced this pull request 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 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.
chenmingwei23 added a commit to chenmingwei23/KiroCrew that referenced this pull request 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 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.
chenmingwei23 added a commit to chenmingwei23/KiroCrew that referenced this pull request 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 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.
chenmingwei23 added a commit that referenced this pull request 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 added a commit that referenced this pull request 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 added a commit that referenced this pull request 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 added a commit that referenced this pull request 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 added a commit that referenced this pull request 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.
bolichen97 pushed a commit that referenced this pull request Sep 18, 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.
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants