Skip to content

fix(files): a shared file is for the person the turn was for (abilityai/trinity-enterprise#549) - #2936

Merged
vybe merged 8 commits into
devfrom
feature/549-file-audience
Sep 22, 2026
Merged

vybe merged 8 commits into
devfrom
feature/549-file-audience

Conversation

@webmixgamer

@webmixgamer webmixgamer commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

agent_shared_files was scoped by agent alone, so the Workspace Files tab listed every active share of an agent — download link included — to everyone on its roster. A file made in one person's chat appeared in another person's tab. Reproduced on a live instance with two accounts before the change, and again in unit form (ADA sees: {'report.pdf'} | BOB sees: {'report.pdf'}) before any code was written.

A share now has an addressee, and the platform decides it — the agent does not choose.

  • Schema — three nullable columns on both migration tracks (addressed_to_email, addressed_to_channel — display only —, audience_source). NULL email and NULL channel is the owner only, which is also what every existing row becomes: no backfill, and every share expires within seven days.
  • services/turn_audience.py keeps two questions apart. Given a turn, who is it for — pure and table-driven over columns every entry path already stamps, with an allow-list of channels. Which turn did this call come from — the hard one: an MCP call carries the agent's key and nothing about the turn, so the only link is an execution id the agent types, and a resumed session cites ids out of its own history (observed live: a turn 22 minutes old). The rule needs positive evidence — only the agent's own key; the cited id must be this agent's; an agent-to-agent child is nobody; otherwise the id proves the conversation and never the person, and that conversation's running direct turns must agree on who it is. Every "could not tell" is the owner only, so the failure direction is under-share.
  • Channel turns read source_channel_client, which the router now stamps only for a verified speaker in a one-to-one chat. In a group the verified email is the unlocker's — set once per group, not per speaker.
  • One override — audience_email, checked with the reader's own roster predicate; an off-roster address is refused by name (AUDIENCE_NOT_ON_ROSTER) and nothing is stored.
  • Readers — the Workspace Files tab narrows in the query to the viewer, plus the owner-only rows for the agent's owner; an unidentifiable viewer matches nothing. The owner's Sharing panel lists everything, gains a For column, and the route withholds the addressee from key-authenticated callers.
  • WhatsApp media and voice notes are addressed by the platform code that already holds the recipient.
  • share_file returns visible_to_requester / visibility_note (the names set_canvas uses) and never an address the platform resolved. The guidance lives in the tool description, since the prompt section is dropped at the minimal tier.
  • The addressee joins the effect key, so re-addressing a file within one turn is a second share rather than a silent replay; the key is hashed and the replay snapshot carries no address, so idempotency_keys never holds one.

The shortcut that must not come back: "the agent has exactly one running turn, so take it." A web-terminal session holds the agent's key, has no execution row, and would hand an operator's file to whichever client happened to be mid-conversation. Four resolver designs were wrong before this one; they are recorded in docs/memory/learnings.md.

Unchanged, and stated: the ?sig= link remains a bearer credential — the audience governs the listing, not the download. On channels, share rows arise only from WhatsApp media and voice notes (Telegram and Slack upload natively). Residual: a session that carries another conversation's history can cite a real id of it; a platform-injected execution id is the structural answer (first slice of #2392 — the resolver already has the slot, and TRINITY_EXECUTION_ID is already in every headless turn's environment).

Reviewer notes

Related Issue

Fixes abilityai/trinity-enterprise#549

Journey Impact

Journey Impact: none: narrows who an existing Workspace listing is shown to — no catalog promise (J01–J11) covers file delivery in the Workspace; a candidate promise for the catalog, not added here

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Testing

tests/unit/test_ent549_file_audience.py — 87 tests built on real-SQLite write→read round trips: the real create_share / create_share_from_bytes into a real database, read back through the real portal_documents, with only the container read and the disk write stubbed. Every earlier share test mocked the persist step and every listing test seeded by INSERT, so nothing crossed write to read. Plus src/mcp-server/src/files.test.ts (6) and src/frontend/tests/unit/sharedFileAudience.spec.js (8).

Full unit run: 16,725 passed. The 6 failures are pre-existing and unrelated — 5 order-dependent tests in test_2703_skill_assign_delivery.py, and test_2814_workflow_trigger_parity.py, which fails identically on a clean origin/dev worktree (its accepted-until-release list needs pruning after the last release cut). Existing tests changed on purpose, each explained in the test itself: the test_ent548 fixture addresses its rows and restates the owner half; the test_idempotency harness loads the real turn_audience; test_ent79 stubs the accessor the reader now calls.

Mutation: 33 call-site mutations, all red, run in isolated scratch copies (restored by copy, never git checkout). Reader back to the operator question — the reported bug — turns 26 tests red, first test_a_file_shared_in_adas_chat_is_in_adas_tab_and_nobody_elses. include_owner_only=bool(is_platform) → test_a_platform_user_who_is_not_the_owner_never_reads_owner_only_files. Router stamps the unlocker in a group → test_the_router_names_nobody_in_a_group_even_though_an_email_is_verified. A cited RUNNING row believed without asking the conversation → test_a_zombie_row_in_a_room_is_not_a_second_opinion_it_is_doubt. The WhatsApp call site forgets the recipient → test_whatsapp_media_is_addressed_to_the_number_the_reply_goes_to. The battery also found a vacuous test (column == None compiles to IS NULL, and the table was empty), since fixed.

Checklist

  • My code follows the project's style guidelines
  • I have updated the documentation (if applicable)
  • I have not committed any sensitive data (API keys, credentials, etc.)
  • I have added appropriate logging for new functionality

Screenshots (if applicable)

The Sharing panel's new For column and both Workspace tabs were checked by the operator on a local instance, light and dark, before this PR was opened.

🤖 Generated with Claude Code

webmixgamer and others added 2 commits September 21, 2026 16:07
…ai/trinity-enterprise#549)

`agent_shared_files` was scoped by agent alone, so the Workspace Files tab
listed every active share of an agent -- download link included -- to everyone
on its roster: a file made in one person's chat appeared in another person's
tab. Third occurrence of one class (asks, reports, now files): a table scoped
by an owning entity gains a per-person dimension, and a reader written before
the column cannot be neutral about it.

A share now has an addressee. Three nullable columns on both migration tracks
(`addressed_to_email`, `addressed_to_channel` -- display only --,
`audience_source`); NULL email and NULL channel is the owner only, which is
also what every existing row becomes, so there is no backfill.

The platform decides the addressee; the agent does not choose.
`services/turn_audience.py` keeps two questions apart. Given a turn, who is it
for -- pure, table-driven over columns every entry path already stamps, with an
allow-list of channels. And which turn did this call come from -- the hard one:
an MCP call carries the agent's key and nothing about the turn, so the only
link is an execution id the agent types, and a resumed session cites ids out of
its own history (observed live: a turn 22 minutes old). The rule therefore
needs positive evidence: only the agent's own key; the cited id must be this
agent's; an agent-to-agent child is nobody; otherwise the id proves the
CONVERSATION and never the person, and that conversation's running direct turns
must agree on who it is. Every "could not tell" is the owner only, so the
failure direction is under-share. The shortcut that must not come back is
"the agent has exactly one running turn, so take it": a web-terminal session
holds the agent's key, has no execution row, and would hand an operator's file
to whichever client happened to be mid-conversation.

On a channel turn the resolver reads `source_channel_client`, which the router
now stamps only for a verified speaker in a one-to-one chat. In a group the
verified email is the unlocker's, set once per group and not per speaker.

- One override: `audience_email`, checked with the reader's own roster
  predicate; an off-roster address is refused by name and nothing is stored.
- The addressee joins the effect key, so re-addressing a file within one turn
  is a second share rather than a silent replay; the key is hashed and the
  replay snapshot carries no address, so `idempotency_keys` never holds one.
- The Workspace Files tab narrows in the query to the viewer, plus the
  owner-only rows for the agent's owner; an unidentifiable viewer matches
  nothing. The owner's Sharing panel lists everything, says who each file is
  for, and withholds the addressee from key-authenticated callers.
- WhatsApp media and voice notes are addressed by the platform code that
  already holds the recipient.
- `share_file` returns `visible_to_requester` / `visibility_note` (the names
  `set_canvas` uses) and never an address the platform resolved; the guidance
  lives in the tool description, since the prompt section is dropped at the
  minimal tier.

Unchanged and stated: the `?sig=` link remains a bearer credential -- the
audience governs the listing, not the download.

Tests: 87 in tests/unit/test_ent549_file_audience.py, built on real-SQLite
write-to-read round trips (every earlier share test mocked the persist step and
every listing test seeded by INSERT, so nothing crossed write to read), plus
mcp-server and frontend helper tests. 33 call-site mutations, all red, run in
isolated scratch copies; the battery is what found a vacuous test
(`column == None` compiles to `IS NULL`, and the table was empty).

Fixes Abilityai/trinity-enterprise#549

Co-Authored-By: Claude Fable 5.1 <[email protected]>
webmixgamer and others added 2 commits September 21, 2026 16:34
…d it as a secret

CodeQL's sensitive-data heuristic classifies any identifier containing
"trusted" as secret material. The unused slot for a platform-injected execution
id was named `trusted_execution_id`, and that value reaches two existing log
lines in `idempotency_service.resolve_and_validate_execution` that print an
execution id -- so the first push raised two HIGH
`py/clear-text-logging-sensitive-data` alerts on a file this change never
touched. An execution id is not a secret; the alerts were true to the naming
heuristic and false to the data.

Renamed to `platform_execution_id` (and the local to `platform_turn`), which is
also what the docs already call it. No behaviour change. A comment at the
declaration says why, so the next reader does not name it back.

Refs Abilityai/trinity-enterprise#549

Co-Authored-By: Claude Fable 5.1 <[email protected]>
A new data flow into an existing log line raises the alert on a file the PR
never touched; the fix is a rename at the source, not a dismissal.

Refs Abilityai/trinity-enterprise#549

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@webmixgamer
webmixgamer requested a review from dolho September 21, 2026 15:54
@vybe

vybe commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

merge-train — not on the 2026-09-21 train; rides the next one once these are settled

Nothing was pushed to this branch. Validated as lane B+schema. Three independent reasons, and the first is the only one that needs your judgement:

1. CodeQL reports 2 new high-severity alerts — "Clear-text logging of sensitive information" at src/backend/services/idempotency_service.py:271 and :280. Worth being precise, because it is not what it looks like at first: that file is not in your diff. Those two logger.warning calls are byte-identical on dev and at this head. The alerts are attributed to this PR because it adds a new caller — services/turn_audience.py — that creates a fresh taint path into pre-existing log lines, and the alerts are not open on dev, so the attribution is real.

My read is that this is very likely a false positive worth dismissing rather than fixing: the arguments are an execution_id and an agent_name, neither of which is a secret. But fix-or-dismiss on a security alert is the author's call, not the train's, which is why this ejects rather than getting patched.

2. Alembic fork with #2920, which is on this train. Both declare down_revision = "0064_executions_search_indexes", which is dev's current head. Two revisions off one parent is two heads, and because upgrade head is singular and resolves its target before applying anything, such a graph applies zero revisions — every revision merged after the fork stops arriving, not just one. Git reports no conflict; each file is individually valid. Re-parent 0068_agent_shared_files_audience onto 0065_agent_skills_delivery_status once #2920 lands.

3. A real conflict with #2920 in src/backend/db/migrations.py — the SQLite track's tail, where you both add an entry. Mechanical, but it has to be resolved against whichever lands first.

So even with the CodeQL alert resolved, only one of #2936 / #2920 could ride this train. #2920 went because it was already validated and conflict-free against dev.

For what it is worth, nothing else about this PR argued against it — it was the freshest thing in the queue and its checks were still running when the queue was walked.

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

⚠️ Alembic head fork if this PR is merged into dev.

dev has advanced since this PR's checks last ran. GitHub recomputes the merge ref when the base moves but does not re-trigger workflows, so a green schema-parity here can describe a base that no longer exists (#2533).

scripts/ci/check_alembic_heads.py against dev + this PR, merged in memory
alembic-heads: FAIL — src/backend/migrations/versions resolves to 2 heads across 69 revision(s); exactly 1 is required.
  • 0067_agent_role_readiness  (0067_agent_role_readiness.py)
  • 0068_agent_shared_files_audience  (0068_agent_shared_files_audience.py)

They fork at: 0064_executions_search_indexes  (0064_executions_search_indexes.py)

`alembic upgrade head` is singular and resolves its target BEFORE applying anything,
so this graph applies ZERO revisions — every revision since the fork stops arriving,
not only the one that forked. Fix by chaining the newer revision off the real head,
or — if the forked revision may already be applied somewhere — by adding a merge
revision (`alembic merge -m "…" <head-a> <head-b>`), whose tuple `down_revision`
converges the line from any starting state. See Architectural Invariant #3.
alembic-heads: src/backend/enterprise/backend/migrations/versions — version directory absent (submodule not initialised) — skipped.

Evaluated on the version line only — this PR also conflicts with dev in 2 unrelated file(s), which do not change this verdict but must be resolved before merge:

docs/memory/learnings.md
src/backend/db/migrations.py

Fix: rechain this PR's revision off 0067_agent_role_readiness (the current dev head), or — if the forked revision may already be applied somewhere — add a merge revision (alembic merge -m "…" 0067_agent_role_readiness 0068_agent_shared_files_audience), whose tuple down_revision converges the line from any starting state. See Architectural Invariant #3.

Push the fix and schema-parity re-checks it against the merge ref immediately; this comment clears on the next push to dev touching src/backend/migrations/versions/**.

Advisory — this check does not block merge. · head_sha: acd69108b5d41754a2dc096ff15b061f40bf96f5 · run

@webmixgamer

Copy link
Copy Markdown
Contributor Author

Thanks — verified all three, and the alembic-head-watch note above.

(1) CodeQL — already fixed, not dismissed. Alerts #365/#366 were raised on the first push (15:18Z). 3b18b1253 renamed the parameter that CodeQL's name heuristic read as a secret (trusted_execution_id → platform_execution_id); both closed as fixed at 15:39Z, with 0 open alerts on this ref and CodeQL green on the head. The queue was walked mid-CI. Agreed the values are not secrets — I renamed at the source rather than dismiss, because the next caller would have re-raised it.

(2) Alembic fork — agreed, and live now that #2920 has landed. One note on the target: #2924 (0066) and #2927 (0067) are stacked on #2920, from the same train, and still open. Checked with check_alembic_heads.py on scratch copies: with all three landed, 0068 → 0065 still forks (against 0066); 0068 → 0067_agent_role_readiness resolves to one head. So rather than re-chain onto 0065 now and fork again when #2924 lands, I'll hold and chain onto whatever dev's single head is once they are in. If either is coming off the train, say so and I'll re-chain onto the current head right away.

(3) Conflicts — agreed. Against the current dev tip it is src/backend/db/migrations.py and docs/memory/learnings.md, nothing else — all tail appends, so keep both, dev's entries first. I rehearsed the merge against the train branch in a scratch worktree (this PR + every member, 0068 re-parented onto 0067): single head, 685 passed / 7 skipped across this PR's tests, the migration / Alembic / schema-parity guards and the members' own test files.

Nothing pushed yet, on purpose — a re-parent pushed before its parent exists on dev would only break this PR's own checks. Once the stack is in: merge dev, resolve, re-chain, fix the description's migration line, push — then it is ready for the next train.

@github-actions

Copy link
Copy Markdown

⚠️ Nightly unit-suite check skipped — merge conflict against dev.

Resolve by running git merge dev locally and pushing the result. The next nightly run will re-test once the conflict is gone.

webmixgamer and others added 3 commits September 22, 2026 13:53
Conflicts: src/backend/db/migrations.py (the SQLite runner's function block
and the MIGRATIONS tail) and docs/memory/learnings.md — all tail appends on
both sides, so dev's entries are kept first and this branch's follow.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…d after #2920/#2924/#2927

Content of both tracks is unchanged; only the Alembic parent moves so the
version line resolves to one head again (Invariant #3, #2068). It was chained
on 0064 while 0065–0067 were still open PRs; they have all landed on dev.

Refs Abilityai/trinity-enterprise#549

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…onvention)

dev now takes new ledger entries as one file per lesson under
docs/memory/learnings/, folded into learnings.md at the release cut, so
same-day PRs stop conflicting on the ledger's tail. The two entries this
branch had appended to learnings.md move there unchanged; learnings.md is
byte-identical to dev again.

Refs Abilityai/trinity-enterprise#549

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@webmixgamer

Copy link
Copy Markdown
Contributor Author

Ready for the next train — dev merged, migration re-chained, CI green on d5fed8eaa.

The description's migration line is updated. Still waiting only on the required review.

@dolho

dolho commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

/review Report

Branch: feature/549-file-audience → dev (merge-base 742b20c13)
Files Changed: 46 (+2692 / −90)
Scope: CLEAN — intent: a shared file is for the person the turn was for. Delivered: exactly that, with the resolver, both readers, the two platform-side channel callers and the owner's panel. Nothing out of scope; client_portal/service.py gains no function (the #2556 hotspot is respected).
Plan Completion: 6 AC done · 1 residual stated (a session carrying another conversation's history can cite a real id of it — platform_execution_id is the slot, #2392) · 0 unverifiable.

Execution coverage (Step 2.5)

changed symbol / test file executed by live consumer verdict
turn_audience.audience_of / resolve_turn_audience / normalize_addressee_email / channel_address / whatsapp_recipient test_ent549_file_audience.py — real create_share → real _persist_and_register → real DB → real portal_documents; only the container read and the disk root stubbed (share_service fixture) agent_shared_files_service, whatsapp_adapter, voice_reply_service ✅
db.list_active_for_viewer + facade round-trip tests read through portal_documents client_portal/service.py:4337 ✅
db.get_running_in_conversation + facade conversation-agreement tests (zombie row, two people, delegated child) turn_audience.resolve_turn_audience ✅
message_router stamp test_the_router_names_nobody_in_a_group_even_though_an_email_is_verified audience_of ✅
_audience_from_override / _visibility / _with_addressee override + visibility tests create_share ✅
routers/agent_files.py (actor_is_agent, show_audience) router tests UI / MCP ✅
sharedFileAudience.js sharedFileAudience.spec.js (8) FileSharingPanel.vue ✅
tools/files.ts files.test.ts (6) MCP server ✅
DDL / revision text pins text pins migration runner, heads guard 🛡 guard

No source-text assertion over a module under test; no bound check at a coinciding value. I re-ran four of the PR's mutations independently, each in a scratch copy, restored by copy:

mutation result
portal_documents back to list_active_shared_files_for_agent (the reported bug) 26 red
include_owner_only=True 14 red
router stamps the unlocker in a group (verified_email or None) 1 red
actor_is_agent=True for every caller 1 red

Suites on my machine: test_ent549 + the three changed neighbours 234 passed, 4 skipped; files.test.ts 6; sharedFileAudience.spec.js 8; heads guard 1 head; test_models_centralized / test_1310_auth_wiring / test_2094 / test_186_enumeration_uniformity / test_1819_rename_cascade_parity 53 passed.

Critical Findings

None.

Informational Findings

[I1] Alembic: 0068 collides with #2949 — a two-head fork the moment both land (Confidence 10/10)
src/backend/migrations/versions/0068_agent_shared_files_audience.py:21 — down_revision = "0067_agent_role_readiness". #2949 (0068_seat_decisions) carries the identical parent. Each PR's check_alembic_heads passes alone; together on dev that is the #2068 fork, where upgrade head resolves its target before applying anything and applies zero revisions.
Not this PR's defect — it was re-chained onto 0067 first and is ahead in the queue. I am re-parenting #2949 to 0069, so nothing is asked of you here; flagging it so the merge train does not take both as-is.

[I2] audience_source reaches a key-authenticated caller while the two address fields are withheld (Confidence 7/10)
src/backend/routers/agent_files.py:539-541

addressed_to=row.get("addressed_to_email") if show_audience else None,
addressed_to_channel=row.get("addressed_to_channel") if show_audience else None,
audience_source=row.get("audience_source"),

No identity in it, and the UI needs it for the "Owner only" reason line — so this is plausibly deliberate. What it does still tell an agent-scoped key reading a sibling's panel is whether each of the owner's shares was addressed at all (turn/override/channel vs none/ambiguous). If that is the intended line, a half-sentence beside show_audience saying "the source is not an identity" makes it reviewed rather than overlooked; otherwise gate it with the other two.

[I3] audienceOf(file) is recomputed up to five times per row (Confidence 8/10)
src/frontend/src/components/FileSharingPanel.vue:76-81 — audienceOf(file).label twice (text + title) and .detail three times, all inside v-for. It is pure and tiny, so this is readability more than cost; a computed keyed by row (or v-for="row in rowsWithAudience") computes it once and reads better at the call site.

[I4] Pre-column rows become owner-only (Confidence 9/10) — stated, not a defect
db/migrations.py::_migrate_agent_shared_files_audience — no backfill by design. A client who legitimately received a file before the upgrade loses it from their tab until it expires. The seven-day expiry bounds the window and the docs say so; recording it here so the deploy note is not a surprise.

Clean Categories

  • SQL & data safety: SQLAlchemy Core everywhere; the new listing is narrowed in the query (or_(*audiences)), and an unidentifiable viewer with no owner flag returns [] before building a statement (db/agent_shared_files.py:265-272) — no "load everything then filter in Python" step that could put another person's download_token one edit away from the response. Migration is three nullable TEXT columns, IF NOT EXISTS on both tracks, no backfill.
  • Auth boundaries: the share route keeps assert_agent_owner; actor_is_agent=bool(actor_agent) with actor_agent = getattr(current_user, "agent_name", None) — an absent attribute is falsy, so the failure direction is owner-only. show_audience = is_interactive_principal(...) is the allowlist predicate (mcp_scope is None), the same one routers/reports.py::_hide_audience uses — not a denylist naming agent/connector (feat: machine identities for admin/ops APIs — service credentials that survive enforced 2FA #2323). _audience_from_override checks the roster with the reader's own predicate (agent_on_roster(..., include_owned=True)), so a stored addressee can always open the tab it decides.
  • Credential / PII exposure: no addressee in any log line — _log prints booleans, _persist_and_register prints audience_source plus a boolean. _with_addressee echoes only an address the agent itself supplied; a platform-resolved verified email never returns to the model. The idempotency snapshot is a copy taken before the echo, so idempotency_keys holds no address (verified: guard.snapshot = dict(result) precedes _with_addressee).
  • Enum / value completeness: audience_source has five values; every one is rendered by sharedFileAudience.js (OWNER_ONLY_REASONS + ADDRESSED_REASONS) with an unknown value falling through to a readable default, and _visibility branches on SOURCE_TURN / SOURCE_AMBIGUOUS with everything else "no claim". _MESSAGING_CHANNELS / _CLIENT_CHANNELS are allowlists — an unknown source_channel makes no claim.
  • Both readers of the table accounted for: list_active_shared_files_for_agent now has exactly two call sites — the owner's panel route and the facade — and portal_documents is the only other reader (grep across src/backend).
  • Format consistency on the WhatsApp lookup (checked, not assumed): whatsapp_recipient passes channel_id, which is NormalizedMessage.channel_id = sender = raw_event["From"] (whatsapp:+…), and set_whatsapp_verified_email stores message.sender_id — the same string. channel_address does not double-prefix it. The voice path's to_number is execution.source_channel_chat_id, same value.
  • The newly stamped source_channel_client on channel turns is inert elsewhere: schedule_seat_memory.seat_for_execution returns early unless source_channel == portal; channel_completion_report compares it only in the portal resolver (:396), and the channel legs' signatures mark it ignored (:162, :211).
  • Internal share path: POST /api/internal/agent-files/share passes no actor_is_agent, so its rows are owner-only — and it has no callers (grep across docker/), which the flow doc states rather than implies.
  • Enterprise-docs guard: the workflow's own PATTERN over the added docs/ lines — no hit.

Summary

  • Critical: 0
  • Informational: 4 — [I1] is cross-PR coordination (handled on my side), [I2] is a question, [I3] cosmetic, [I4] stated
  • Scope: clean

The resolver is the part worth the reading time, and it is the part that is written most carefully: two questions kept apart, positive evidence required, every "could not tell" landing on under-share. The four failed designs recorded in learnings.md are the most useful artifact in the PR.

@vybe

vybe commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

merge-train 2026-09-22: riding this train. Validated lane B+schema (/validate-pr READY, /review READY; both migration tracks present, check_alembic_heads → 69 revisions / 1 head at 0068, check_alembic_parity PASS, raw-color ratchet on FileSharingPanel.vue paid down 49→37). Nothing pushed to this branch. The portal gate was traced to fail closed (an external viewer never receives NULL-audience rows; a channel-only row appears in nobody's tab), the WhatsApp/voice recipients match the key set_whatsapp_verified_email stored under, and sharedFileAudience.js is imported and rendered in the "For" cell. Two notes for after merge: the closer is cross-tracker (Fixes abilityai/trinity-enterprise#549), so status-in-dev on ent#549 is set by hand; and models._normalize_audience vs turn_audience.normalize_addressee_email are two spellings of the same rule (both fail closed today, but that is the shape that drifts).

…y.json rebuilt (keep both, #2947's entries + ours)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@vybe

vybe commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

merge-train: merged dev into this branch to resolve the tests/registry.json append-collision with #2947 (both PRs added entries; rebuilt keep-both, 262 entries, no duplicates). No other files changed. Merges once the required checks re-run.

@github-actions

Copy link
Copy Markdown

⚠️ Live-instance suite skipped — merge conflict against dev.

Resolve by merging dev locally and pushing the result; the next nightly re-tests.

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge-train: batch validated on train/20260922-1340 (train PR #2954, full suite green)

@vybe
vybe merged commit 7d851cb into dev Sep 22, 2026
27 checks passed
@webmixgamer
webmixgamer deleted the feature/549-file-audience branch September 22, 2026 14:26
vybe pushed a commit that referenced this pull request Sep 23, 2026
…it row — the #2807 case no longer reads its neighbour's (#2952) (#2978)

* test(mcp): each loop-tool call drains and identity-checks its own audit row (#2952)

The #2807 transport cases awaited the first `run_agent_loop` row past an
index sampled at test start. That is a position, not an identity: the
previous test never awaited its own fire-and-forget row, so on a busy
host its late `success: true` row was the first match and the refusal
read as audited-as-success (CI run 35730033664 on PR #2936).

Every call through `asAgent().call` now drains the row at its own call
index before parsing the envelope, and checks it for tool and session
(a per-session bearer the stub echoes back as `key_name`). A loud
precondition (rows == calls) makes a change to withAudit's one row per
call break this file on purpose. audit.ts is untouched (#2926).

Evidence: the stub recording its row 50 ms late reds the dev file
(5 tests / 4 pass / 1 fail, 3 of 3 runs; also at 200 ms) and leaves the
fixed file 5/5 (3 of 3 at 50 ms, 1 of 1 at 200 ms). A constant key_name
reds 5/5 with "row N is not this session's". Unperturbed: npm test
504/504, file alone 10/10.

Also registers access-wiring.test.ts in tests/registry.json (it had no row).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(learnings): awaiting a fire-and-forget recorder is not identity (#2952)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* docs(learnings): state only the evidenced #2952 chain — CI failed one case; the sibling's red is timing-dependent (#2952)

CI run 35730033664 attempt 1 failed only the refused-loop case (464/465);
the fragment claimed the sibling case chained into 'stale refusal' there.
Under the 50 ms stub perturbation the original sibling case goes red on
either 'first' (a late success row) or 'second' (a refusal row) depending
on arrival order — say that instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* test(registry): access-wiring row uses the catalog's access-control category and records its #2952 update (#2952)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: trinity-ability <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants