Repository navigation
[Team] Add a human-readable authorization and task audit trail #57
Description
Planning ID: TODO-L
Proposed issue / PR title: feat(audit): record collaboration authority and task transitions.
Goal: a person can understand who requested, approved, ran, cancelled and accepted work.
Scope: append-only application audit events for membership/Chief changes, important authorization decisions, task transitions and approvals. Include actor, owner, task/request IDs and timestamps; omit secrets and unnecessary private message bodies. Restrict audit access by owner/room/team scope and expose a minimal task activity view.
Out of scope: compliance certification, tamper-proof claims, external SIEM integration or recording every model token.
Dependencies: TODO-G (#52), TODO-I (#54), TODO-J (#55).
Code area: authorization/task event emission, persistence and existing activity/detail UI.
Acceptance and tests: the pilot task’s visible audit explains the full authority chain; unauthorized users cannot read private owner audit detail; secret-shaped test data is not logged; failed and rejected actions are distinguishable from executed actions. Revocation does not erase relevant historical attribution.
Plan update (2026-10-16, team mode via groups): No separate team-mode subsystem is needed; groups with per-Bot grants cover it, and this is step 5 of the ordered plan on #51 (after #56). Audit events start being emitted in step 1 (#149), so history is not lost. Effort: M.
- Gives:
task.actors[], approval records (ownerId,reason,by, stale/denied outcomes), room attribution androom.log. - Gap: no append-only log;
tasks,room.logand approval records are pruned at 200; membership, Chief and grant changes are not logged; no activity view. - Append-only
state.audit: ring of about 2k entries (oraudit.jsonlin home). Entry:{at, kind, actorId, ownerId, taskId?, requestId?, roomId?, outcome: executed|rejected|failed, ref}; whitelisted fields only, never bodies or secrets. - Existing seams: emit from
transition,hold/decide/release, reach denials,setGrants,syncDesignatedChiefandroom-membershipjoin/leave. - Scoped read endpoint:
audit, filtered by owner or room membership window (reuselinesVisibleTologic). Revocation keeps attribution. - Timeline on the task card: a task card in the room (
kind:'task'lines inroom.log) with an expandable timeline. - Test: include a secret-shaped string and assert it is not logged.
Delivery
One focused implementation PR for this issue. This is planned work, not a claim of shipped multi-human support. Preserve the pristine upstream pin and generated patch/client boundaries. Keep team mode disabled until the documented authorization gates pass. Record exact tested head, executed checks, missing checks and independent review. No production credentials or live deployment are part of this issue.
Activity
Track tasks with a lifecycle and requester-only acceptance (#54)
Track tasks with a lifecycle and requester-only acceptance (#54)
Agent inbox: show failed turns and a latest-activity line on each card (
Birfy commentedon Oct 20, 2026
Triaged: this is team-via-groups work, and the team mode contract is not shipped (AGENTS.md: team mode stays disabled until the authorization gates in
docs/subsystems/team.mdpass; issue #16 is resolved as Option B and must not be re-opened).So it is not
agent-ready: it waits for the owner to explicitly turn team work on. Labeledneeds-human; automation leaves it alone and writes no code for it.HugoXK commentedon Oct 21, 2026
Design for the owner to pick. The events exist today but are scattered: approval records (
state.flybot.approvalswith owner+provenance, #52), task transitions (#54), membership/Chief changes (setMain,deleteBot), and the decision log (#396/#565). There is no single append-only trail.(a) A local append-only JSONL + a read endpoint (recommended, personal scope).
core/src/host/audit.jsappends one line per event (actor, owner, kind, task/request ids, time; never secret values or message bodies), and a read-only endpoint lists/filters it. The existing surfaces emit into it (approvals, tasks, setMain/deleteBot, the decision feed). Scoped to the owner while single-human.(b) Team-scoped access. As (a) with per-owner/room filtering for several humans; waits on team mode (#51/#149).
(c) Tamper-evident (hash chain). As (a) plus a hash chain so edits are visible; more than the "human-readable" goal #57 asks.
Recommendation: (a). It gives the human-readable authority/task trail #57 asks for on the shipped single-human product, and is the foundation (b) and (c) build on. The decision log (#396) is a natural first emitter; its scope decision is a separate owner call.
fix(issue-ref): read a bare ThinkFlowLab#1234 only when the number st…