Repository navigation
fix(prompt): keep coding-agent delegation inside Trinity's execution ledger (abilityai/trinity-enterprise#643) - #3937
Conversation
…ledger (Abilityai/trinity-enterprise#643) Every platform-prompt tier and runtime carries a standing instruction against launching coding-agent CLIs as subprocesses, pointing agents at Claude subagents or Trinity delegation instead, so delegated work stays visible, attributable and within the turn's authorization.
|
✅ Nightly unit-suite clean when this PR is merged into |
dolho
left a comment
There was a problem hiding this comment.
Thanks for this. The section reads well, the runtime-conditional alternative is honest, and the new suite tests the rendered prompt directly rather than the source.
Two required checks are red on the current head, and both need a change before merge:
-
regression diff:test_ent419_memory_poisoning_gates::test_every_structural_heading_of_the_composed_prompt_is_guardedfails. The anti-poisoning guard from #3912 (merged into this branch from dev) pins every platform heading againstSTRUCTURAL_HEADINGSinsrc/backend/services/user_memory_guard.py. Adding"stay inside trinity's execution ledger"to that set fixes it. Locally,test_ent419+test_ent643then pass (395/395). -
journey-impact: the parser reads**Journey Impact:** none — ...as** none — .... Please use thenone: <reason>form, e.g.Journey Impact: none: advisory platform instructions; rendering covered by unit regressions.
Minor: Refs abilityai/trinity-enterprise#643 is not a closing keyword. Since it is cross-tracker it would not auto-promote anyway, so ent#643 will need a manual status-in-dev after merge.
Please push the fix and re-request review.
…bilityai/trinity-enterprise#643) #3912 pins every level 1-3 heading of the composed system prompt against STRUCTURAL_HEADINGS, so a remembered note cannot repeat a platform section heading. This branch adds "### Stay inside Trinity's execution ledger" to the platform instructions, which left test_every_structural_heading_of_the_composed_prompt_is_guarded red once dev was merged in. Registering the folded title closes it.
# Conflicts: # docs/memory/feature-flows.md
|
Thanks — all three addressed, point by point:
Re-requesting review. |
dolho
left a comment
There was a problem hiding this comment.
Re-review at afc021f26 — both requested changes are in
-
regression diff:"stay inside trinity's execution ledger"is now inSTRUCTURAL_HEADINGS(user_memory_guard.py:422, commit4d9cf56d).test_ent643_platform_cli_boundary.py+test_ent419_memory_poisoning_gates.pyon the head: 395 passed. -
journey-impact: the body now readsJourney Impact: none: advisory platform instructions…, the form the parser accepts.
| Check | Result |
|---|---|
| Change | one always-tier section in PLATFORM_INSTRUCTIONS, with a runtime-conditional in-turn alternative (Agent/Task only for Claude Code runtimes, own tools otherwise), plus the heading registered in _KNOWN_SECTION_HEADINGS and the memory guard ✅ |
| Honesty | states "turn-scoped" as authorization, never as storage, so an agent cannot disprove it with one command ✅ |
| Docs | requirements, flow + index, agent-runtime.md, two user docs ✅ |
| Secrets / host paths | none ✅ |
| CI | 20 pass / 6 skipped, regression diff green ✅ |
Execution coverage (§5.4)
The new suite asserts the rendered prompt per tier and runtime, and it fails 198/198 on the unchanged service, so it executes platform_prompt_service compose, not its source.
Reminder: Refs abilityai/trinity-enterprise#643 is cross-tracker, so ent#643 needs a manual status-in-dev after merge.
APPROVE.
🤖 Reviewed with Claude Code
Every platform-prompt tier and runtime receives a standing instruction against launching coding-agent CLIs as subprocesses. It explains turn scope as authorization for Trinity-run coding-agent execution and states why nested CLIs escape cost attribution, autonomy gates, permission enforcement and audit.
The instruction directs agents to available Claude subagents or Trinity delegation, explicitly using parallel mode for in-turn self-targeting and model overrides. It makes no claim that credentials are inaccessible or that nested authentication always fails.
The change is advisory. Deterministic CLI enforcement and direct provider API calls are outside this PR. Registry management, composed preview and disabled-entry visibility remain with ent#140.
Existing pull composition failures can still omit all platform guidance; that pre-existing behavior is documented in a separate local bug draft and unchanged here.
Validation:
expected exactly one '### Stay inside Trinity's execution ledger' section, found 0dev(seeds 643 and 7331).env, no submodules), seed 12345test_ent643_platform_cli_boundary198)devlint_sys_modules(130 ≤ 131),lint_root_test_placement, enterprise-docs guard (0 hits),git diff --checkThe local runs other than the 3.13 row used Python 3.14.4. Across the cross-branch Python 3.13 run the only red is a pre-existing timing flake on unmodified
dev(test_ent879_aauth_resource_route, seed 67890; 8 of 2000 isolated repeats fail), on no branch.Mutation (each on a scratch copy, new suite of 198): runtime swap removed → 13 failed; heading not registered → 1; heading added to the MINIMAL drop set → 31;
parallel=trueremoved → 10;_CLAUDE_SUBAGENT_RUNTIMESdropsclaude→ 2; a storage/failure claim inserted → 20; marker fill removed → 36; launcher made unconditional → 5; reason clause removed → 10; "directly or through scripts or wrappers" removed → 10; section padded past 1,000 chars → 16; each of three owner-drift mutations (chat.ts, denied tools, Claude runtime names) → 1. The validate gate reproduced 8 of these with identical counts.Review: an independent code review approved, with one wording nit on the user doc, applied; it included reading the finished rendered sections from the agent's perspective and found no additional in-scope loophole, false claim or missing alternative. An independent security review approved. The feature flow was updated by hand with the disclosure guard run;
tests/registry.jsonand the test-runner catalog are deliberately unchanged. Docker and the production-image check: not run.Journey Impact: none: advisory platform instructions and runtime-specific alternatives; rendering and delivery are covered by unit regressions.
Fixes abilityai/trinity-enterprise#643.