Skip to content

feat(members): append-only crew ledger with pluggable contributors - #11964

Closed
chenmingwei23 wants to merge 2 commits into
mainfrom
feat/members-event-log-relanded
Closed

chenmingwei23 wants to merge 2 commits into
mainfrom
feat/members-event-log-relanded

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Same commit as #9907, raised from a branch in this repository so the review lanes can post their findings. On a fork the reviewers hold a read-only token for this repo, so their comment write fails: the check-run reports a count and the detail comment never appears, which leaves nothing to adjudicate. #9907 stays open as the original; this branch carries the identical tree at 3200dbc1f9.

What is the problem?

A crew member's state lives in several places (trust files, activity files, in-memory registries), each read separately and reassembled by the Members page, which refetches the whole roster on every change. Nothing outside the gateway process can contribute state about a member, so any plugin or app that has something to say about a crew has to be written into the gateway itself.

A second problem sits inside the first, and it is what the top commit fixes. The per-member log was written to <data home>/members/<slug>/log.jsonl, which is not fenced: is_sensitive_path answers False for it, and _CREW_HIDDEN_LEAVES does not hide it from a sandboxed subprocess. So an agent could rewrite the append-only record that dispatch trust reads. The crew log it duplicates, crew-log/log.jsonl, is fenced on both gates, which is the whole reason that root exists.

Why this issue matters to the user

Members page changes appear without a refresh and survive restarts with a reason (a patrol interrupted by a restart reads "interrupted", not "armed"). Any app or adapter, in any language, can read a member's history, record its own facts, and put a view on the member's card through one wire contract, while the gateway stays the only writer and enforces ownership and quota at the boundary.

An audit record an agent can edit is not an audit record. A rewritten one cannot be detected afterwards, which is the property that makes keeping it worthwhile.

How our fix solves it

Per-member append-only ledger and projections, piloted on the Members page (src/kiro_crew/eventlog/, docs/system-specs/modules/member-event-log.md). One writer, contiguous seq, fsync before announce, synthesized closers written on cold load, whole-value pushed frames, reconnect as truncate then reseed. Presence stays live and is joined at render time.

Contribution protocol (docs/system-specs/modules/contribution-protocol.md): manifest-declared contributions checked on every call; catch-up GET plus a WebSocket delta channel with the contiguity rule; namespaced appends with size and budget limits; whole-value projection publish with higher-seq-wins; teardown withdraws views and keeps events; the drawer renders any contributed view generically from a small declarative schema.

The storage half is now the crew log rather than a second mechanism beside it. member joins crew and session as a unit kind in src/kiro_crew/crew_log/, so the log lands at <data home>/crew-log/members/<store name>/log.jsonl and inherits the existing fence by construction instead of needing a parallel one. MemberLog became an adapter over Ledger, using append, iter_from for the protocol's forward catch-up, page for history and last_seq for the cursor. SCHEMA_VERSION stays 1 because the schema's own rule is that additive changes never bump it, and TYPE_OWNERSHIP[KIND_CREW] already owned the four namespaces this reserves (member, activity, slot, patrol).

One behaviour changed in a shipped module rather than being added to it: check_ownership rejected a guest app: type by comparing the kind against KIND_CREW. A contributor writing to a member log needs those types, so the rule now reads KIND_SOURCE_PREFIXES[kind]: a kind accepts a guest's type exactly when it accepts that guest's src. Session logs still refuse them, because they declare no guest prefix. That removes a hardcoded special case instead of adding one.

kirocrew app import (apps/plugin_import.py, docs/system-specs/modules/plugin-import.md) converts a manifest-declared plugin bundle (skills, MCP servers, hooks, connectors) into an installable app; docs/system-specs/modules/harness-plugin-mapping.md records which foreign plugin kinds reach which extension point and which do not.

docs/request-for-change/rfc-crew-native-append-only.md states the model in plain language and answers the crews-managing-crews question: storage follows the subject, visibility follows grants, the tree is a view.

One platform defect fixed on the way: a builtin's manifest snapshot dropped contributions (the repo's own round-trip guard was red on it).

An adapter that hosts an unmodified plugin written for a foreign plugin runtime was built and validated against this protocol on a separate branch (feat/dsh-adapter) and is deliberately not part of this PR; the RFC keeps it as the worked example of what an adapter is.

What tests we did

The fence is a test, not a claim: is_sensitive_path answers True for crew-log/members/<fold>/log.jsonl and False for the old members/<slug>/log.jsonl as the control, and the test goes red if crew-log is unnamed on the tool gate.

Each translation the adapter performs is pinned by mutation: dropping the seq - 1 translation reds 7 tests, storing a contributed type without its app: prefix reds 1, dropping the bad-payload-to-ValueError translation reds 1.

Backend: 489 pass across the eventlog, contribution protocol, members, dm-thread, wiring and docs-reference suites, plus 1032 across all 16 crew_log files. eventlog/log.py coverage went 81% to 96%; eventlog_hooks.py 72.7% to 85%; dashboard/ws.py gained 39 covered statements, measured by running the ws suites with and without the new file (178 missing to 139). The PR's own _handle_eventlog_frame had no test at all before this.

Frontend 148 pass (members page, projection store, contributed card); npx tsc -b clean; adapter Node suite 48/48; flake8 and mypy clean on touched files; scripts/docs-lint.sh passes.

End to end in isolated pods: a star toggled outside the browser lands as one pushed frame with zero refetch; a seeded patrol/started plus restart writes patrol/stopped {reason: interrupted} exactly once; a reference contributor completes token exchange, catch-up, subscribe, three appends, fold and publish, and after being stopped while two events were appended by another client, resumes through GET ?after= and republishes; three real published plugin bundles import, enable and register their MCP server into the pod's agent config.

Two behaviours the fold changed, both measured rather than assumed. A damaged committed line no longer kills the whole file. The store skips it inside a segment on purpose, so the two tests asserting LogCorrupt there were asserting the old rule; LogCorrupt now covers an unparseable header, without which nothing in the file is attributable. And a bad payload arrived as LedgerError where one caller distinguishes a client's bad append from a server fault by type, so the adapter carries the store's coded refusal back as ValueError while the store keeps making the judgement.

Any other suggestions on the work

Two behaviour bounds this change carries, itemized here because a reader should
not have to find them in the diff. The duplicate-session probe reads the member's
own ACTIVITY_RECORD events rather than scanning a file, and that scan is
UNBOUNDED on purpose: the log is already materialised in memory by the same read,
so a cap saved no I/O and did cost a miss (a session resumed after enough later
events deduped against nothing and wrote a second participation record). And the
contributed-projection wire now carries stateVersion on the push frame and in
the roster baseline, because the server accepts a refold whose version rose even
when its seq did not advance, and a browser applying seq-wins alone dropped
exactly that frame.

Known gaps, listed in the RFC's last section and in each commit body: slot/opened fires only for member-created slots, so a member never driven by an agent folds to zeros; the app token travels in the query string and should move to a header before this leaves draft; the protocol has no version field in its handshake yet; the plugins that matter most fold session events, so session sharing this envelope with the ACP-replay direction in #8862 is the next step. The branch is large because the protocol is only provable with a real contributor on the other side (the reference client in test/contrib_protocol_demo.py); it can be split into the ledger, the protocol and the importer if reviewers prefer.

Disclosed rather than widened: eventlog/contrib.py keeps an external projection store at <data home>/eventlog/contrib, also unfenced. It holds derived projections rather than the audit record, so it is a different class of artifact and a different decision; it is not changed here.

Screenshots

All captured at the current head via the PR's own harness (website/scripts/capture-members-patrol.mjs).

The one visible behaviour this PR changes: the Crew Members drawer when a patrol was interrupted by a gateway restart. It reads a sentence ("Interrupted by a restart."), not a raw token, and the patrol still lists under Wake sources as a muted "Patrol stopped." row.

That row is the fix for a contradiction UX Review found in an earlier revision of this branch: the empty-wake branch fired whenever the patrol was not ACTIVE, so a durably-stopped patrol rendered "Patrol stopped. Interrupted by a restart." directly above "Nothing wakes this member automatically." A stopped patrol still IS a wake source, just not an armed one, so it lists muted the way a disabled job does.

Crew Members drawer: patrol stopped, "Interrupted by a restart.", listed under Wake sources as a muted "Patrol stopped." row

The reshaped Crew Members page at rest -- roster plus the Crew summary with the Auto patrol detail:

Reshaped Crew Members page

A patrol reported armed by the wake projection before any loop record lands: the drawer reads "Patrolling" and lists the patrol as a wake source (no interval yet), instead of a lit icon over "No patrol scheduled":

Projection-armed patrol: "Patrolling" verdict and wake-source row

The contributed-view cards the drawer renders once an app publishes on a member's log. Each is drawn from the value plus a declarative schema (no contributor code runs), and they mount BELOW the member's own Configuration so a chatty app adds to the drawer's tail rather than displacing it. A populated keyvalue card (final-segment labels, last/total, not the raw pings.last selector) and its empty-body state:

Contributed keyvalue card, populated

Contributed card, empty body ("Nothing to show yet")

The remaining body kinds, one still each: a badge, a text body, a list sliced past its 20-row cap with the "+N more" marker (the same honesty the member's own activity counts get), and a table with its declared columns:

Contributed badge body

Contributed text body

Contributed list body with "+N more" marker

Contributed table body

Behaviour is also covered by the vitest suites (MembersPage.test.tsx, memberProjectionStore.test.ts, useMemberProjection.test.tsx, ContributedViewCard.test.tsx).

@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Sep 19, 2026
Comment thread test/contrib_protocol_demo.py Fixed
@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 19, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/members-event-log-relanded branch from 3200dbc to c5abffa Compare September 19, 2026 07:43
@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 19, 2026
A crew member's state lives in several places (trust files, activity files, in-memory registries), each read separately and reassembled by the Members page, which refetches the whole roster on every change. Nothing outside the gateway process can contribute state about a member, so any plugin or app that has something to say about a crew has to be written into the gateway itself.

Members page changes appear without a refresh and survive restarts with a reason (a patrol interrupted by a restart reads "interrupted", not "armed"). Any app or adapter, in any language, can read a member's history, record its own facts, and put a view on the member's card through one wire contract, while the gateway stays the only writer and enforces ownership and quota at the boundary.

Per-member append-only ledger and projections, piloted on the Members page (`src/kiro_crew/eventlog/`, `docs/system-specs/modules/member-event-log.md`). One writer, contiguous seq, fsync before announce, synthesized closers written on cold load, whole-value pushed frames, reconnect as truncate then reseed. Presence stays live and is joined at render time.

Contribution protocol (`docs/system-specs/modules/contribution-protocol.md`): manifest-declared `contributions` checked on every call; catch-up `GET` plus a WebSocket delta channel with the contiguity rule; namespaced appends with size and budget limits; whole-value projection publish with higher-seq-wins; teardown withdraws views and keeps events; the drawer renders any contributed view generically from a small declarative schema.

An adapter that hosts an unmodified plugin written for a foreign plugin runtime was built and validated against this protocol on a separate branch (`feat/dsh-adapter`) and is deliberately not part of this PR; the RFC keeps it as the worked example of what an adapter is.

`kirocrew app import` (`apps/plugin_import.py`, `docs/system-specs/modules/plugin-import.md`) converts a manifest-declared plugin bundle (skills, MCP servers, hooks, connectors) into an installable app; `docs/system-specs/modules/harness-plugin-mapping.md` records which foreign plugin kinds reach which extension point and which do not.

`docs/request-for-change/rfc-crew-native-append-only.md` states the model in plain language and answers the crews-managing-crews question: storage follows the subject, visibility follows grants, the tree is a view.

One platform defect fixed on the way: a builtin's manifest snapshot dropped `contributions` (the repo's own round-trip guard was red on it).

On the integrated branch: backend 893 passed / 2 skipped across the eventlog, contribution protocol, members, plugin import, app manifest and bridges, error-code contract, ws scoping and route-table suites; frontend 148 passed (members page, projection store, contributed card); `npx tsc -b` clean; adapter Node suite 48/48; flake8 clean on touched files; `scripts/docs-lint.sh` passes.

End to end in isolated pods: a star toggled outside the browser lands as one pushed frame with zero refetch; a seeded `patrol/started` plus restart writes `patrol/stopped {reason: interrupted}` exactly once; a reference contributor completes token exchange, catch-up, subscribe, three appends, fold and publish, and after being stopped while two events were appended by another client, resumes through `GET ?after=` and republishes; three real published plugin bundles import, enable and register their MCP server into the pod's agent config.

Not run: the full CI suite. That is what this draft is for.

Known gaps, listed in the RFC's last section and in each commit body: `slot/opened` fires only for member-created slots, so a member never driven by an agent folds to zeros; the app token travels in the query string and should move to a header before this leaves draft; the protocol has no version field in its handshake yet; only the `member` kind exists, and the plugins that matter most fold session events, so `session` is the next kind and should share this envelope with the ACP-replay direction in #8862. The branch is large because the protocol is only provable with a real contributor on the other side (the reference client in `test/contrib_protocol_demo.py`); it can be split into the ledger, the protocol and the importer if reviewers prefer.
@chenmingwei23
chenmingwei23 force-pushed the feat/members-event-log-relanded branch from c5abffa to 51ee5b0 Compare September 19, 2026 07:55
@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

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

Design-Verdict: CONCERNS

New public wire contract ships with two self-acknowledged defects — query-string token, unversioned handshake — that ossify once external contributors bind to it.

Watch

  • The contribution protocol is a contract for out-of-process, any-language contributors, yet ships with the app token in the query string (leaks into access/proxy logs; the network is a named boundary) and no version field in the handshake — the description itself says the token "should move to a header before this leaves draft," but this PR is the draft leaving. Both fixes become breaking changes the day a real contributor exists, with no negotiation mechanism to soften them.
    Clears when: the token moves to a header and the handshake carries a version field in this PR, or the protocol spec explicitly marks the wire contract unstable/draft so contributors cannot claim compatibility.
  • <data home>/eventlog/contrib is new, unfenced, and reseeds dashboard-rendered contributed cards on cold load, so a sandboxed agent can forge a view the drawer presents as an app's. The PR's own argument for the ledger move — "that property has to hold by where the file lives rather than by someone remembering to list it" — applies to this store too; "derived, not audit" bounds the damage but not the spoofing channel to the human.
    Clears when: the contrib store moves under a fenced root (or gains a sandbox disposition), or reseeded projections are validated/attested before render.

Suggestions

  • Take the author's own offer: land plugin_import.py + its CLI + three docs (~2,000 lines with tests) as a separate PR — it shares no runtime seam with the ledger or protocol and doubles this PR's review surface.

[DESIGN-REVIEWED] 619879c

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — 🟡 CONCERNS

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

UX-Verdict: CONCERNS

Contributed cards read as content of unknown origin — the blind reader could not tell what they are, who put them there, or if they're real.

Watch

  • Provenance of contributed cards: the only cue is an unlabeled gray app pill; reader on shots 04–09: "I cannot tell what any of them actually are … or who put them there. I would not act on anything in them." Hits every user of a contributing app, persistent friction. Smallest fix: title/tooltip on the pill in ContributedViewCard.tsx — "Contributed by the {app} app".
  • Detail-less "Patrolling" verdict (shot-03, the new patrolState === 'active' bare branch): reader "cannot tell whether fixer's patrol has no schedule or the details just aren't shown" — and the screenshot shows it as a steady state on a member last seen 2d ago, not a race blink. Add one muted line ("Schedule details unavailable") under the verdict.
  • "Patrol stopped" now renders twice on one panel (Auto patrol section + the new Wake sources row, shot-01); reader: "I could not say which one I'm supposed to look at." Consider dropping the trailing "Patrol stopped" text from the wake row, keeping the muted styling.

[UX-REVIEWED] 619879c

@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 19, 2026
@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 619879cc9dd4dda093c88a4f2205d1e22523e77b — 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 contribution protocol ships with zero in-tree contributors — its only consumer is deliberately left on an unmerged branch — plus a kind registry holding one kind.

Not justified as shipped

  • Item 5 — zero consumers: the description itself defers the sole consumer ("built and validated against this protocol on a separate branch (feat/dsh-adapter) and is deliberately not part of this PR"); grepping contributions across src/kiro_crew finds only the defining/enforcing sites, no app manifest declaring it, and register_unit has exactly 1 call (eventlog/contrib.py:144, docstring: "Today: member"), so the kind-generic {kind} routes and UnitRegistry generalize for one constructed variant.
    Subtraction: defer the contributor-facing half — eventlog/contrib.py, eventlog/grants.py, dashboard/handlers/eventlog.py, dashboard/eventlog_ws.py, the manifest Contributions block, ContributedViewCard.tsx — to land with its first consumer; at minimum collapse the one-entry registry to the literal member kind.
    Clears when: an app declaring contributions merges in-tree (e.g. feat/dsh-adapter), or the protocol surface is split out of this PR.
  • Item 9 — undeclared: bundle budget raised 12240→12300 KB; measured in-file per that file's own convention, harm-free rider.

What this change ships

Inventory (10 items, capped) — 8 justified

Intent: make a crew member's state one append-only, tamper-fenced record that external apps can read and contribute to — an ADDITION (the "unfenced log" fixed exists only in the PR's own history, not on base).

  1. Members page updates arrive as pushed frames, no roster refetch — justified
  2. Member state survives restart with a reason ("interrupted", not "armed") — justified
  3. Member history is an append-only log under the fenced crew-log root; the old rotated activity file is migrated in and retired (its fail-closed tests pinned the agent-writable file the fence removes) — justified
  4. member becomes a third crew-log kind; guest-type acceptance read off each kind's declared prefixes, sessions still refuse — justified
  5. Installed apps can declare contributions to read/append/publish views onto a member's card — zero consumers, registry with one entry
  6. New CLI kirocrew app import converts a foreign plugin bundle into an installable app — justified
  7. New RFC and module specs ship alongside the code — justified
  8. Gateway boot reconciles member logs; config saves and patrol changes emit member events — justified
  9. Frontend bundle budget 12240→12300 KB — undeclared, measured rider
  10. members_subscribed baseline and stateVersion on push frames (fixes a measured dropped-frame case) — justified

The member-projection push shape is covered on the base by rfc-append-only-ledger.md (in-progress), which names member_projection frames, cold-load closers (FR-8), and the activity-file migration (§7), so no product-shape trigger fires.

[FIRST-PRINCIPLES-REVIEWED] 619879c

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 19, 2026
@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 619879cc9dd4dda093c88a4f2205d1e22523e77b — this comment is updated in place on each push.

Review details

FINDING — the §6 teardown deletion frame omits stateVersion, so a contributed card that ever refolded (stateVersion ≥ 1) is never cleared by the immediate push.

FINDING — src/kiro_crew/apps/teardown.py:169 — the deletion frame {unit.id_field: unit_id, "key": key, "value": None, "seq": _DELETION_SEQ} carries no stateVersion, so useWebSocket coerces it to version = 0; when the client Row holds stateVersion ≥ 1 (any contributor that published a refold — _push_projection sends "stateVersion": state_version, and the roster seed carries versions[key] = ext.state_version), memberProjectionStore.apply hits stateVersion < existing.stateVersion → return and drops the teardown before the isTeardown removal runs, leaving the disabled app's stale card on screen until the next roster reconcileContributed refetch (or indefinitely if none fires) → Fix: add a maximal "stateVersion": _DELETION_SEQ to the deletion frame in _push_projection_deletions so it clears the version gate.

[OPUS-REVIEWED] 619879c

Verdict parsed from the review's SHA-scoped output markers for commit 619879cc9dd4dda093c88a4f2205d1e22523e77b.

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

@chenmingwei23
chenmingwei23 force-pushed the feat/members-event-log-relanded branch from 51ee5b0 to 09e6cb9 Compare September 19, 2026 08:42
@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — 🔴 changes requested (blocking)

GPT 5.6 found at least one blocking issue that must be resolved before merging 619879cc9dd4dda093c88a4f2205d1e22523e77b. 3 of 7 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

This comment is updated in place on each push.

BLOCKING -- src/kiro_crew/eventlog/grants.py:74 -- contribution authorization blocks the event loop
if is_app_enabled(app): manifest = get_app_manifest(app)
Cold grant lookup on slow storage -> async HTTP/WS handler -> synchronous metadata reads -> gateway loop stalls.
Anchor: no-blocking-call-on-event-loop
Fix: resolve declarations through an awaited thread/executor call.

BLOCKING -- src/kiro_crew/dashboard/handlers/eventlog.py:239 -- failed appends consume quota
get_budget().charge(app, kind, unit_id)
Near-limit data -> charge succeeds -> crew-log envelope exceeds its limit -> repeated failed writes exhaust quota.
Anchor: persist-before-you-publish
Fix: release the reservation whenever append fails.

BLOCKING -- src/kiro_crew/eventlog/contrib.py:395 -- projection rows have no population bound
rows[key] = row
Wildcard-granted app -> publish unlimited distinct keys -> retained memory, file size, and roster responses grow without limit.
Anchor: a-bound-bounds-every-field-it-retains
Fix: bound rows per app/unit and retained key/schema-selector lengths.

BLOCKING -- src/kiro_crew/apps/plugin_import.py:834 -- malformed keywords crash the import command
keywords = [k.strip() for k in data.get("keywords", []) if isinstance(k, str) and k.strip()]
Manifest containing "keywords": 1 -> CLI conversion -> uncaught TypeError and traceback.
Anchor: residual/crash-data-loss-corruption
Fix: validate that keywords is a list and raise PluginImportError otherwise.

BLOCKING -- src/kiro_crew/eventlog/service.py:227 -- cached logs omit commits from other processes
log = self._logs.get(slug)
select_crew subprocess append -> gateway reads cached MemberLog -> activity and projections remain stale until a local append or restart.
Anchor: residual/crash-data-loss-corruption
Fix: refresh cached logs from disk before reads or route writes through the gateway.

BLOCKING -- src/kiro_crew/dashboard/ws.py:428 -- disable can race a subscription grant (origin: validation)
if not grants.may_use_kind(ws_app, kind): ... await asyncio.to_thread(resolve_unit, kind, unit_id) ... hub.subscribe(ws, kind, unit_id)
Subscribe begins while enabled -> disable revokes during unit resolution -> request resumes and registers an untracked socket that receives later events.
Anchor: residual/security
Fix: re-check the grant immediately before hub.subscribe.

BLOCKING -- src/kiro_crew/eventlog/contrib.py:460 -- failed row deletion is published as durable (origin: validation)
self._flush(kind, id_, rows, best_effort=True)
Unwritable projection file -> in-memory deletion and null frame succeed -> restart reloads the supposedly deleted app rows.
Anchor: persist-before-you-publish
Fix: propagate persistence failure and restore deleted rows before teardown publishes removals.

[BLOCK-MERGE] 619879c
[GPT-REVIEWED] 619879c

Adjudication (Opus 4.8) — is blocking on each finding proportionate?

All four adjudicable findings cite AUTOSDE anchors that carry blocking: true, and I confirmed each is a genuine instance of its rule from the code on disk.

F1 — no-blocking-call-on-event-loop (AUTOSDE:91-92, blocking: true). grants.may_use_kind/may_append (eventlog.py:228,230) are called synchronously on the async handler — unlike resolve_unit, which is offloaded via to_thread at eventlog.py:225 — and reach _declaration (grants.py:74), which does a synchronous manifest file read + JSON parse (get_app_manifest, manager.py:2065) on a cold cache. Rule flag is authoritative.

F2 — persist-before-you-publish (AUTOSDE:681-682, blocking: true). charge() reserves quota at eventlog.py:239 before the append at eventlog.py:248; the failure branch (eventlog.py:249-252) returns without releasing the reservation, violating the rule's "release the reservation on EVERY refusal" clause.

F3 — a-bound-bounds-every-field-it-retains (AUTOSDE:862-863, blocking: true). rows[key] = row (contrib.py:395) has no COUNT bound on distinct keys and no per-string bound on retained key/value/schema; the only cap in the module is on the budget dict, not the projection rows.

F7 — persist-before-you-publish (AUTOSDE:681-682, blocking: true). delete_app_rows deletes in-memory rows (contrib.py:458) then flushes best_effort=True (contrib.py:460), which swallows the persistence failure (contrib.py:331-335); the caller then publishes durable removals over a disk file that still holds the rows.

The rule flag outranks proportionality weighing in every case (reason code autosde-blocking-rule).

Fenced findings. F4: "keywords": <non-list> is ordinary malformed external plugin-manifest input, exactly what the import path ingests — not an extreme combination. F5: cross-process appends to a cached MemberLog (service.py:227 returns the cached copy without re-reading disk) is a plausible multi-process operational path. F6: a disable landing in the window between the grant check (ws.py:428) and hub.subscribe (ws.py:442) during the awaited resolve_unit is a real concurrency race on the security class. None reaches the extreme-rarity bar FLAG requires; torn on the security/residual class resolves to UPHOLD-FENCED.

[ADJUDICATION] 619879cc9dd4dda093c88a4f2205d1e22523e77b total=4 uphold=4 downgrade=0
UPHOLD F1 src/kiro_crew/eventlog/grants.py:74 reason=autosde-blocking-rule
UPHOLD F2 src/kiro_crew/dashboard/handlers/eventlog.py:239 reason=autosde-blocking-rule
UPHOLD F3 src/kiro_crew/eventlog/contrib.py:395 reason=autosde-blocking-rule
UPHOLD F7 src/kiro_crew/eventlog/contrib.py:460 reason=autosde-blocking-rule
[GPT-ADJUDICATED] 619879cc9dd4dda093c88a4f2205d1e22523e77b
[ADJUDICATION-FENCED] 619879cc9dd4dda093c88a4f2205d1e22523e77b fenced=3 flagged=0
UPHOLD-FENCED F4 src/kiro_crew/apps/plugin_import.py:834 -- a non-list `keywords` is ordinary malformed third-party manifest input, precisely what the import path exists to ingest.
UPHOLD-FENCED F5 src/kiro_crew/eventlog/service.py:227 -- cross-process appends to a cached MemberLog are a plausible operational path, not an extreme combination.
UPHOLD-FENCED F6 src/kiro_crew/dashboard/ws.py:428 -- a disable landing during the awaited resolve_unit is a real concurrency race on the security class; torn resolves to uphold.
[GPT-ADJUDICATED-FENCED] 619879cc9dd4dda093c88a4f2205d1e22523e77b

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

@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 19, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

First Principles item 7, the one-kind UnitRegistry: declining the subtraction, with the measurement.

The finding's count is right on the write side and I reproduced it: one register_unit call, one registered kind (member).

What the subtraction would cost is on the read side, which the count does not cover. Four call sites in three modules resolve a kind through the table:

Consumer What it does with the lookup
apps/manifest.py:2336 unit_kinds() is the set an app's declared contributions are validated against
apps/teardown.py:156 get_unit(kind) to withdraw an app's rows on disable
dashboard/eventlog_ws.py:207 get_unit(kind) on the subscribe path
eventlog/contrib.py:577 get_unit(kind) on the append/publish path

{kind} is a URL path segment, so every one of those is validating foreign input. Inlining replaces one table with a "member" comparison at four sites, and the manifest one is the load-bearing case: it does not branch on the kind, it reports which kinds an app may declare, so it needs the SET, not a comparison. Producing that set from a hardcoded literal in manifest.py is how the validator and the router drift apart, which is the failure the table prevents.

So I read this as a real observation whose remedy costs more than the generalization does. UnitKind is not speculative structure around one branch: it is the one place a wire parameter is resolved, and its value is that four independent modules cannot disagree about what a valid kind is.

The finding's own clearing condition is "a second kind is registered by a merged change, or the registry is inlined". The RFC's session kind is the second one, and the ACP-replay direction in #8862 is where it lands, so this clears by the first condition rather than the second.

Items 6 and 8 from the same review are adopted on 09e6cb962c: the seq - 1 wire translation is gone (the wire now carries the crew log's own seq; removing it reded exactly 16 tests across two files, all updated), and MemberLog.committed_bytes is deleted.

@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 19, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/members-event-log-relanded branch from 09e6cb9 to bbf91d1 Compare September 19, 2026 09:41
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 19, 2026
chenmingwei23 added a commit that referenced this pull request Sep 19, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 19, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
chenmingwei23 added a commit that referenced this pull request Sep 20, 2026
…-log root

Extracted from #11964 as the ledger half: the member event log, its
projections, the Members page live updates, and the move of the per-member
log under the already-fenced crew-log/ root.

The contribution protocol and the plugin importer are deliberately NOT here
-- they are separate PRs, which is what both reviewers asked for.
@bolichen97

Copy link
Copy Markdown
Contributor

Closing in favour of #9907, which implements the same change.

Evidence. Same title, same author, 83 of 93 files shared (64 after excluding common-surface files), including the crew-log envelope docs and the RFC itself.

Why this one and not #9907. #9907 is the newer cut of the same umbrella and is the one to carry it forward.

This is not a judgement on the work -- the two changes were written independently and this one is not the weaker of the pair, it is the one that does not need to land twice. If you disagree, or if #9907 turns out to miss something this branch handles, say so and I will reopen this.

From a full relationship audit of every open PR against main (baseline a992d5cda5). Overlap was measured with git diff against each branch's own merge base, and re-measured after excluding files that 20+ open PRs touch, so shared locale and lockfile edits could not inflate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants