Skip to content

chore: reconcile main into dev ahead of release v1.0.5 - #4600

Merged
vybe merged 8 commits into
devfrom
chore/reconcile-main-1.0.5
Nov 17, 2026
Merged

vybe merged 8 commits into
devfrom
chore/reconcile-main-1.0.5

Conversation

@trinity-ability

Copy link
Copy Markdown
Contributor

What

A merge of main into dev that keeps dev's tree unchanged (zero file diff).

main carries 7 commits that are not ancestors of dev: the security back-ports #4291, #4294, #4314, #4315, #4399, #4400 and the llms.txt refresh #4287. Without this merge the dev → main release PR conflicts in five files.

Why dev's tree is kept

A trial merge auto-resolves every file to dev's content except five, and in each of those dev holds the fuller version:

File main side dev side
src/frontend/package.json + lockfile older axios / chart.js / js-yaml / marked / mermaid newer versions, same DOMPurify 3.4.17
CredentialsPanel.vue lacks two imports has them
tests/registry.json subset superset
test_ent1117_s11_env_escape_table.py trimmed for main (no agent_env_patch) full test

One thing main has that dev does not: follow-redirects 1.16.3 in the frontend lockfile (dev pins 1.16.2). Left for the normal dependency update.

Merge

Merge commit only, never squash. A squash drops the main parent and the release PR conflicts again.

🤖 Generated with Claude Code

trinity-ability and others added 8 commits November 6, 2026 06:32
…4287)

llms.txt had not changed since it was added (2026-07-15). Rewrite it from the
current README: the "operating system for the AI-native company" positioning,
Trinity 1.0 (roles, objectives, gated skills, Inbox approvals, PostgreSQL),
the MCP surface, open-core split and pentest facts. Add a "For AI agents"
section pointing at AGENTS.md, the agent install runbook, the compatible
agent guide, the system manifest guide and the MCP reference, and map every
user-docs area (agents, governance, Workspace, automation, channels, API,
deploying, related repos). FAQ count corrected to 650+. All relative links
verified against both main and dev.

Co-authored-by: trinity-ability <309458136+trinity-ability@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
…kfile (Abilityai/trinity-enterprise#1117) (#4314)

Lockfile-only; package.json is unchanged. Regenerated with npm 10 (the
node:22 image's major) via `npm update ... --package-lock-only`.

- proxy-addr 2.0.7 -> 2.0.8 (Critical, GHSA-jqcg-44mw-7w3h)
- @modelcontextprotocol/sdk 1.30.0 -> 1.32.2 (four High advisories)
- body-parser 2.3.0 -> 2.4.0 (High), with its content-type 2.0.0 -> 2.1.0
- follow-redirects 1.16.0 -> 1.16.2 (two High; 1.16.2 also fixes
  GHSA-mrwp-f3q8-3g9p, which still affects 1.16.1)
- undici 8.11.2 -> 8.12.4 (three High; 8.12.4 also fixes
  GHSA-mqg3-3v4r-cm32, which affects 8.12.2-8.12.3)
- qs 6.16.0 -> 6.17.1, fast-uri 3.1.7 -> 3.1.9, ip-address 10.7.2 -> 10.7.6,
  hono 4.13.13 -> 4.13.16, @hono/node-server 2.1.0 -> 2.1.6,
  iconv-lite 0.7.2 -> 0.7.3 (Moderates)

npm audit: 9 (1 critical, 4 high, 4 moderate) -> 0. npm ci, build and
the package's 1227 tests pass before and after.

(cherry picked from commit d70abc7)
…opy, follow-redirects 1.16.2, undici 7.30.2 (Abilityai/trinity-enterprise#1117) (#4315)

* fix(frontend): bump dompurify to 3.4.17, follow-redirects to 1.16.2, undici to 7.30.2 (Abilityai/trinity-enterprise#1117)

dompurify is raised in both `dependencies` and `overrides` to ^3.4.17; the
override collapses monaco-editor's exact 3.4.15 pin onto the same copy.
follow-redirects and undici move lock-only. The lock was regenerated with
npm 11.20.0, the npm the node:26 production image ships; no package entry
was added or removed (447 before and after). npm also drops a stale
`@rollup/rollup-linux-arm64-musl` line from the root `dependencies`
record; package.json lists it only under optionalDependencies, where it
stays.

npm audit: critical 1 / high 2 before, 0 / 0 after.

DOMPurify 3.4.16 moved its build to rolldown, which emits double-quoted
string literals, so the allowlist scraper in markdownCodeBlocks.spec.js
found nothing. It now accepts either quote style and keeps its >100
non-vacuity floor (573 names scraped from 3.4.17).

(Abilityai/trinity-enterprise#1117)

* fix(brain-orb): replace the vendored DOMPurify 3.4.11 with the locked 3.4.17 UMD build (Abilityai/trinity-enterprise#1117)

public/brain-orb/vendor/purify.min.js ships in dist and sanitises
agent-authored markdown in orb.js, but it is not a package, so npm audit
and Dependabot never saw it. It was 3.4.11, inside the vulnerable ranges.

The new file is dist/purify.min.js taken unmodified from the
dompurify-3.4.17 tarball, whose sha512 matches the lockfile integrity.

ent1117VendoredDompurify.spec.js ties the copy to the lockfile: the
license banner version must equal the locked dompurify version, the
bytes must equal the installed (integrity-checked) dist/purify.min.js,
and running it as a classic script must define a working
window.DOMPurify. The last two catch the ESM build, which carries the
same banner but leaves window.DOMPurify undefined, so orb.js would fall
back to plain text.

(Abilityai/trinity-enterprise#1117)

* test(frontend): pin a single dompurify in the lock and compare the vendored copy byte for byte (Abilityai/trinity-enterprise#1117)

overrides.dompurify in package.json is what stops npm from nesting
monaco-editor's exact 3.4.15 pin, which is inside the vulnerable ranges.
Dropping it and relocking left every test green. The spec now fails when
package-lock.json holds any dompurify other than the root entry.

The byte-identity check read both files as UTF-8 strings; it now
compares raw bytes, so the test does what its name says.

* test(frontend): count an npm-aliased dompurify in the one-copy lock check (Abilityai/trinity-enterprise#1117)

An alias dependency ("x": "npm:dompurify@<old>") is locked under its own
key, not under node_modules/dompurify, and overrides.dompurify does not
collapse it. The one-copy check matched keys only, so such a copy passed.
It now also counts any lock entry whose name is dompurify.

(cherry picked from commit 7fabb0c)
…i/trinity-enterprise#1117) (#4294)

* fix(agent-server): a sync path can no longer be read as a git option (Abilityai/trinity-enterprise#1117)

The Push endpoint staged the caller's paths with `git add <paths>`, so an
element such as `-f` was parsed as an option: `paths: ["-f", ".env"]`
force-staged the gitignored .env and the same sync committed and pushed it.
Stage with `git add -- <paths>`, so every element is a pathspec.

The test drives the real endpoint against a scratch repo with a local bare
origin and asserts on what reached origin; the no-paths `git add -A` branch
is pinned unchanged.

* fix(git): the sync route refuses a path that starts with '-' (Abilityai/trinity-enterprise#1117)

An agent keeps the agent server it was created with until it is recreated
on a new base image, and the older server stages paths without `--`. The
backend sync request now rejects any `paths` element starting with '-' with
a 422 that names the element, before the agent is called. A dash elsewhere
in a path (`sub/-x.md`) is accepted; a file whose name starts with '-' can
be named as `./-name`.

* fix(mcp): git_sync refuses a path that starts with '-' (Abilityai/trinity-enterprise#1117)

The git_sync tool schema now rejects any `paths` element starting with '-'
with a parameter error naming the element (`paths.<i>: '<element>' starts
with '-' ...`), so the call never reaches the backend. The constraint is
also advertised in the tool's JSON schema as `pattern: ^(?!-)`.

* test(agent-server): a subset sync pushes only the named paths (Abilityai/trinity-enterprise#1117)

The plain-paths sync test changed only the files it named, so staging
everything (`git add -A`) whenever `paths` is given passed it too. It now
also modifies an unrelated tracked file and asserts that file is not in
origin's tree at its new content and is still dirty locally. It also names
a root-level file whose name starts with '-' as `./-x.md`, the spelling the
backend's 422 recommends, and checks it is pushed.

(Abilityai/trinity-enterprise#1117)

* test(git): the API and the git_sync tool decide one shared table of paths alike (Abilityai/trinity-enterprise#1117)

The backend model and the MCP tool schema each refuse a sync path that
starts with '-'. Nothing pinned that they agree, so either side could
become stricter (reject ' -f' or '') or looser (a multiline regex accepts
'-f\nx') and a caller would get different answers from the API and from
MCP. Both test files now read tests/fixtures/git-sync-path-cases.json and
must decide every row the same way: options, a lone dash, '--', dash then
NUL or newline are refused; leading whitespace, an empty string, './-x',
a dash after a slash or newline, Unicode dashes and a BOM are accepted,
because git reads an option only when the first byte is an ASCII '-'.

The "names the element" checks now require the message to lead with the
element (`paths[i] '<elem>' starts with '-'` and `'<elem>' starts with
'-'`). The old substring check passed for ["-"] even with the element
dropped, since "'-'" is already in "starts with '-'".

(Abilityai/trinity-enterprise#1117)

* fix(git): cap the path echoed in a refused sync request (Abilityai/trinity-enterprise#1117)

A sync path that starts with '-' is refused with a message that names the
element twice: once to point at it, once in the './<name>' suggestion. The
request bounds nothing, so a 10,000-character element made a ~20 KB 422.
The backend validator and the git_sync tool schema now echo at most 200
characters of the element, followed by an ellipsis. The message still
leads with the index and the element.

(Abilityai/trinity-enterprise#1117)

* test: register the sync-path option tests in tests/registry.json (Abilityai/trinity-enterprise#1117)

(Abilityai/trinity-enterprise#1117)

* test(git): the shared path table covers every Unicode dash probed against git (Abilityai/trinity-enterprise#1117)

The table held three of the seven Unicode dashes that were checked
against git. A backend that also refused U+2013 or U+2014, which the MCP
tool accepts, passed both suites. It now holds U+2010, U+2011, U+2013,
U+2014, U+2212, U+FE63 and U+FF0D as accepted rows, and the coverage test
requires all seven.

The file is now plain ASCII with \u escapes, so the BOM, zero-width space
and soft-hyphen rows cannot be stripped by an editor without showing in
the diff.

(Abilityai/trinity-enterprise#1117)

* fix(git): a refused sync path carrying a lone surrogate is a 422, not a 500 (Abilityai/trinity-enterprise#1117)

A JSON body may carry an unpaired surrogate as an escape, for example
{"paths": ["-\ud800"]}. The refusal message quoted the element once
through repr() but put it raw into the './<name>' suggestion. A raw lone
surrogate cannot be encoded as UTF-8, so pydantic-core raised
UnicodeEncodeError while building the validation error and the route
answered 500 before the 422 handler ran. The suggestion now goes through
repr() too. For every ordinary element the message text is unchanged
('./-f').

The shared path table gains two refused rows with a lone surrogate and
one accepted row (a surrogate with no leading dash). A route test sends a
surrogate first, in the middle, inside the 200-character echo and past it,
and requires a 422 whose body decodes as strict UTF-8 JSON. On the MCP
side, the same elements are refused with an error that serialises to
valid UTF-8 JSON. The MCP tests pass before and after this change, because
JSON.stringify already escapes a lone surrogate.

(Abilityai/trinity-enterprise#1117)

* fix(mcp): cut the echoed sync path by code points, not UTF-16 units (Abilityai/trinity-enterprise#1117)

The git_sync refusal echoes at most 200 characters of the element. The
cut counted UTF-16 units, so an emoji straddling unit 200 was split and
the message carried half of a surrogate pair. The cut now counts code
points, the same unit the backend uses, so it never splits a pair.

(Abilityai/trinity-enterprise#1117)

* ci: run the MCP server tests when the shared sync-path table changes (Abilityai/trinity-enterprise#1117)

tests/fixtures/git-sync-path-cases.json is read by both the backend unit
tests and the MCP git_sync tests. The backend workflow has no path filter,
but the MCP workflow ran only on src/mcp-server/**. A change to the table
alone could therefore break the MCP side without CI noticing. The table
is now in both of that workflow's path lists.

(Abilityai/trinity-enterprise#1117)

(cherry picked from commit 22e5942)
Abilityai/trinity-enterprise#1117) (#4291)

* fix(helper-mcp): move to @modelcontextprotocol/sdk ^1.32.0 and zod ^4.6.7 (Abilityai/trinity-enterprise#1117)

trinity-docs-mcp is a published npm package, so consumers resolve from the
package.json ranges rather than this lockfile. Raise the SDK floor to
^1.32.0 (fixed releases for the four SDK advisories) and move zod to
^4.6.7 (the zod advisory has no 3.x fix). The lock also picks up the
patched express chain: proxy-addr 2.0.8, body-parser 2.4.0, qs 6.17.1,
fast-uri 3.1.9, hono 4.13.16, @hono/node-server 2.1.6, ip-address 10.7.6.

npm audit: critical 1, high 3, moderate 5 before; 0 after.

Runtime behaviour is unchanged. Under zod 4 the advertised ask_trinity
inputSchema no longer carries additionalProperties:false (extra keys were
and still are accepted), and validation messages are worded differently.
A new test pins the observed contract: an oversize question comes back as
a JSON-RPC result with isError:true and "MCP error -32602: Input
validation error" text, without reaching the docs endpoint.

* chore(helper-mcp): version 0.2.0 for the zod 4 dependency major (Abilityai/trinity-enterprise#1117)

The previous commit changes a runtime dependency major, so the next
trinity-docs-mcp release should be 0.2.0 rather than an automatic patch.
SERVER_VERSION (reported as serverInfo.version) and package.json now say
0.2.0; the release is cut by pushing the tag helper-mcp-v0.2.0.

* test(helper-mcp): pin wrong-type, null and astral ask_trinity inputs (Abilityai/trinity-enterprise#1117)

A number, null, an array or a missing value for question, and null or a
number for session_id, each return the -32602 input-validation result
naming the field, and the docs endpoint is never called. A schema that
coerced question to a string would now fail three of these cases.

zod 4 counts a string's length in code points, zod 3 counted UTF-16 code
units. Pin what that means here: 4001 UTF-16 units in 2001 code points
passes the schema and is stopped by the client guard with its own text,
4000 units is accepted, and 4001 code points is still rejected by the
schema. The unknown-key test now also checks the forwarded body.

* fix(helper-mcp): report the installed package version and pin the patched dependency floors (Abilityai/trinity-enterprise#1117)

SERVER_VERSION was a string literal, so any release whose version the
publish workflow writes into package.json (every automatic patch release)
would report a stale number in serverInfo and the startup log. Read it
from the package's own package.json, which sits one level above both
src/ and dist/ and is always in the published tarball. A missing version
fails at startup instead of reporting an empty one.

Also pin that the lockfile copies of @modelcontextprotocol/sdk, zod,
proxy-addr and body-parser, and the declared sdk and zod ranges, stay at
or above the first patched versions of the advisories fixed here.

* test(helper-mcp): pin that a package.json without a usable version stops startup (Abilityai/trinity-enterprise#1117)

readPackageVersion now takes the manifest URL and is exported, so the
refusal path is tested directly: no version field, an empty version and a
numeric version each throw "package.json at ... has no version", and a
valid version is returned. A version that silently fell back to a default
would fail all three refusal cases.

(cherry picked from commit 3acf8ef)
…n-security-patch

fix(security): the four Critical scanner fixes from dev, on main (Abilityai/trinity-enterprise#1117)
…ed root lockfile, WhatsApp/log/credential-panel fixes (Abilityai/trinity-enterprise#1117) (#4400)

* chore(deps): remove the unused repo-root package.json and package-lock.json (Abilityai/trinity-enterprise#1117) (#4316)

The root manifest dates from the initial commit and declares only
@modelcontextprotocol/sdk plus overrides. Nothing installs, copies or
resolves it: every npm call in CI runs in src/frontend, src/mcp-server or
src/helper-mcp; the frontend, mcp-server and base images build from their
own subfolder contexts; the backend and scheduler images use the repo root
as context but copy only named backend, scheduler, config and VERSION
paths; no script or doc runs npm at the root; and every bare import in
each Node package is present in that package's own lockfile.

Keeping it meant patching its lockfile for alerts on code that never runs.

(cherry picked from commit 9bae16e)

* fix(deps): bump vite in the git-sync test harness and black in the test requirements and backend image (Abilityai/trinity-enterprise#1117) (#4292)

* fix(deps): bump vite to 8.3.5 in the git-sync test harness lock (Abilityai/trinity-enterprise#1117)

vite 8.2.1 is inside GHSA-587h-7wmj-h5pm (>= 8.2.0, <= 8.2.3, High).
Lock-only change, regenerated with npm 11.20.0
(npm update vite --before=2026-11-04 --package-lock-only --ignore-scripts);
package.json is unchanged. vite 8.3.5 matches src/frontend. The only other
movement is vite's own rolldown 1.2.4 -> 1.2.16 and @oxc-project/types.
The harness's vitest suite passes 10/10 before and after; npm audit High 1 -> 0.

* fix(deps): bump black to 26.10.1 in the test requirements and the backend image (Abilityai/trinity-enterprise#1117)

black 26.5.1 is inside GHSA-cg8m-r9f2-5wm2 (< 26.10.1, High). black is not
a tool this repo runs: it is a declared runtime requirement of payments-py
1.18.0, and both files pin that runtime set exactly so the image and CI
exercise the same SDK stack. The pin moves in both files together, because
tests/unit/test_ent679_payments_pin_parity.py compares the Dockerfile pin
with the installed version and fails when only one file moves (checked in
both directions).

A fresh Python 3.13 venv resolves the full tests/requirements-test.txt
with exit 0 before and after, 174 packages each, and black is the only
version that changes; the same holds for the Dockerfile's pip install set
(171 packages). test_ent679_payments_pin_parity.py: 20 passed.

(cherry picked from commit adac3a5)

* fix(backend): linear WhatsApp markdown conversion, secret-free boot and fork logs, anchored consent check (Abilityai/trinity-enterprise#1117) (#4296)

* fix(whatsapp): markdown conversion runs in linear time (Abilityai/trinity-enterprise#1117)

The header and link rules in _markdown_to_whatsapp were quadratic in the
reply length: 8-11 s of CPU for one 64 KB agent reply, spent synchronously
on the event loop. The header title now starts and ends on a non-space so
the trailing \s* never competes with it; link text may not contain a
bracket, and the URL may contain anything but ')' except the '](' that
starts the next link, so IPv6 hosts and ?filter[]= queries still convert.
Regex input is clamped to the largest response the platform accepts
(4,000,000 chars, the result-callback cap); any excess passes through
unconverted.

Tests pin 4/16/64 KB growth on CodeQL's pump strings, bracket URLs, the
clamp, equivalence with the previous rules on realistic replies, and the
three intentional differences.

* fix(logs): boot warning and fork log carry no secret-derived detail (Abilityai/trinity-enterprise#1117)

A weak ADMIN_PASSWORD made the boot log list each failed rule, which gave
away the password's length, its missing character classes and whether it
is on the public common-password list. The warning now prints the fixed
rules line, identical for every password.

The fork-to-own clone-failure log scrubbed git output a second time;
_run_git already returns it scrubbed, so the line logs that output
directly. Output is identical (scrubbing is idempotent for tokens without
'*'), verified through a real _run_git against a git that prints the token.

* fix(sanitizer): anchor the consent client_id check and pin the key scan as linear (Abilityai/trinity-enterprise#1117)

The Google-consent client_id check is a re.fullmatch; a leading '^' is a
no-op there and lets static ReDoS analysis, which treats every pattern as
unanchored, see the anchor. Applied to the backend and agent-server copies
as a one-character change, so no other line in either file moves.

New growth-ratio tests time the key=value scan and the client_id check at
three sizes on the pump strings static analysis reports, in both copies,
and check that the same harness flags known-quadratic counterfactuals.

* test(whatsapp): declare the header-title difference and check that the declared differences are the only ones (Abilityai/trinity-enterprise#1117)

The linear header rule requires the title to start on a non-space, so a
header whose title starts with whitespace that the `[ \t]+` after the marks
does not take (`\r`, `\f`, `\v`, NBSP, U+3000, ...) is now left as it is
instead of becoming a bold line. That is a fourth intentional difference
from the previous rules; it is now pinned next to the other three.

A new test compares the conversion, on 20,000 seeded random strings over
markdown punctuation and every non-newline whitespace character, with an
independent statement of the previous rules plus the four declared
differences, and a second test checks the corpus reaches each difference on
its own. The header rule itself is unchanged: it stays the form already
confirmed linear.

* docs(whatsapp): state the reply caps the conversion clamp is sized against (Abilityai/trinity-enterprise#1117)

The comment on `_MARKDOWN_CONVERSION_MAX_CHARS` said agent replies reach
the conversion uncapped and that the clamp equals the largest response any
path accepts. Neither is exact: the sync task path cuts a reply at 10,000
chars, proactive text is capped at 4,096, the async result callback at
4,000,000, and the pull result route sets no length cap. The clamp is sized
to the callback cap, and on the pull path it is the only bound on the regex
work. Comment and test wording now say that; the value is unchanged.

* test(boot): tie the weak-password rules line to the validator's length bounds (Abilityai/trinity-enterprise#1117)

The boot warning's rules line is a literal so it can carry nothing derived
from ADMIN_PASSWORD, which means its "12-128 characters" could drift from
password_validation.MIN_LENGTH/MAX_LENGTH unnoticed. A test now reads both
constants and requires the boot output to state exactly that range.

* test(whatsapp): the completeness check names the expected output when it fails (Abilityai/trinity-enterprise#1117)

* docs(whatsapp): a channel reply has no length cap on push or pull, so the clamp is the only bound (Abilityai/trinity-enterprise#1117)

The previous wording named a 10,000-char sync task cap and implied the
push path was bounded. That cap is AgentClient's task parser, which no
WhatsApp path uses. A channel turn runs through execute_task, whose
inline /api/task response is not length-checked, and the 4,000,000-char
result-callback cap applies only to schedule and webhook triggers. On the
pull path the result route sets no cap either. The comment and test
wording now say that the clamp is the only bound; its value is unchanged.

* test(whatsapp): pin that a header takes one to six marks (Abilityai/trinity-enterprise#1117)

The random corpus never produced six or more `#` followed by a space, so
widening or narrowing `#{1,6}` passed every test. Two explicit rows and
two corpus tokens now cover six marks (a header) and seven (not one).

* merge-train: the WhatsApp feature flow states the linear conversion rules and its clamp (#4296)

Mechanical, per the merge-train note on the PR. The outbound markdown section
did not mention the 4,000,000-character clamp or the four inputs that now
convert differently.

Part of Abilityai/trinity-enterprise#1117.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: trinity-ability <309458136+trinity-ability@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 65d0b3e)

* fix(credentials): escape backslashes when the Credentials panel writes .env (Abilityai/trinity-enterprise#1117) (#4297)

* refactor(credentials): move the .env value encoding into utils/envFile.js (Abilityai/trinity-enterprise#1117)

The Credentials panel's .env writer and reader move, unchanged, into one
module beside each other, so the encoding can be tested on its own and
against the agent's encoder. No behaviour change.

* fix(credentials): escape backslashes when the Credentials panel writes .env (Abilityai/trinity-enterprise#1117)

The panel rewrites an agent's whole .env on every save. Its writer escaped
`"` but not `\`, while its own reader and the agent's unquote_env_value
(#2023) both turn `\\` back into `\`. So a credential containing two
backslashes lost one the next time any credential in the file was saved,
and the agent then authenticated with a value nobody supplied.

The writer now escapes backslash before quote, which is the agent's own
encoding. The comment that argued against widening the escaping was
written before #2023 gave the agent a reader that unescapes, and is
rewritten to say what is true now.

One value -> line table (tests/fixtures/ent1117-env-escape-cases.json,
generated from the agent's format_env_line) is checked by a vitest spec
against the browser encoder, decoder and a mounted Quick Inject save, and
by a pytest against the agent's encoder, decoder and file parser and the
backend's agent_env_patch writer.

* chore(frontend): delete the unused useAgentCredentials composable (Abilityai/trinity-enterprise#1117)

Nothing imports it: the Credentials panel carries its own implementation,
and the composable's only reference was its re-export from
composables/index.js. It still held the old .env writer that escapes `"`
but not `\`, so it is removed rather than fixed.

* chore(frontend): delete the uncalled formatGithubRepo from ReplayTimeline (Abilityai/trinity-enterprise#1117)

The function has no caller in the component's script or template, or
anywhere else in the tree.

* fix(agent): mcp_template reads .env values with the agent's own decoder (Abilityai/trinity-enterprise#1117)

agent_server/mcp_template.py renders .mcp.json.template from .env at every
container start. Its reader reversed only \" and left \\ doubled, while every
writer of the file (the agent's format_env_line, the backend's agent_env_patch
and now the Credentials panel) escapes the backslash. A panel-saved C:\path
was therefore rendered into .mcp.json as C:\\path.

The reader now decodes exactly like execution_env.unquote_env_value: one
matched quote pair stripped, \" and \\ reversed in a single scan inside double
quotes, single-quoted values literal. The decoder is mirrored rather than
imported because importing the services package loads the runtime modules on
this standalone boot path.

The table test now holds mcp_template to the agent's reader per row, over a
whole panel-written file, over every right-hand side up to six characters, and
through render() end to end. A second fixture of lines the new writer never
produced (the old panel writer's output, single-quoted, unquoted and lone-quote
lines) pins every agent-side reader to what execution_env returns for them.
(Abilityai/trinity-enterprise#1117)

* test(credentials): the panel keeps reading existing .env lines as before (Abilityai/trinity-enterprise#1117)

The panel's reader also meets lines its new writer never produced: what it
wrote before backslashes were escaped, hand edits and Quick Inject pastes.
The spec now checks unquoteEnvValue against tests/fixtures/ent1117-env-legacy-reads.json,
whose panel column was produced by running the previous reader, asserts the
panel and the agent differ only on a lone single quote, and mounts the panel
to show a Quick Inject carries each such line over as the value it read.

Both fixtures join the frontend-build path filter, so a change to either runs
the browser spec as well as the pytest twin.

* docs(credentials): describe the current .env encoding and its readers (Abilityai/trinity-enterprise#1117)

credential-injection.md still said the deleted useAgentCredentials composable
exists, that only " is escaped, and that widening the escaping would make the
agent-side mismatch worse; none of that has been true since #2023. It now
names the shared encoding, every reader of the file, the two fixtures that
hold them together, and the three single-key readers that only strip quotes.

CLAUDE.md said .mcp.json.template rendering is "not yet live"; startup.sh has
run it at every agent start since #2013.

* test(credentials): the ent127 round trip runs utils/envFile.js and covers backslashes (Abilityai/trinity-enterprise#1117)

test_ent127_frontend_contract.py extracts parseEnvText and formatEnvContent
from CredentialsPanel.vue and runs them under node. Since the encoding moved
into utils/envFile.js those functions call the imported formatEnvLine and
unquoteEnvValue, so every round trip died with "ReferenceError: formatEnvLine
is not defined" (17 of 37 failed).

The script now defines both functions from utils/envFile.js itself, anchored
on the panel's import and the file's two exports, so it runs the code the
panel ships. VALUES gains a\\b, C:\path\new, a trailing backslash and a
backslash before a quote; with the quote-only encoder a\\b fails both round
trips.

* test(agent): hold mcp_template's .env decoder to the agent's with blanks around = (Abilityai/trinity-enterprise#1117)

The exhaustive comparison now writes every value twice, once as K=v and once
as K = v, so dropping the strip before decoding fails it.

The docstring gave the wrong reason for copying the decoder. Under
python3 -m agent_server.mcp_template the package import has already loaded
execution_env. The real constraint is the flat, by-path load the module
supports: there the name "services" is ambiguous, and in a test process it
resolves to the backend package, which has no execution_env.

* docs(credentials): state both legacy fixture columns and the one mcp_template upgrade change (Abilityai/trinity-enterprise#1117)

* merge-train: guided-credential-setup no longer calls the .env escaping mismatch open (#4297)

Mechanical, per the merge-train note on the PR. Section 6 still said the
agent's reader does not unescape and listed the mismatch as follow-up 5; this
PR closes both, so the paragraph now points at the shared rules in
credential-injection.md.

Part of Abilityai/trinity-enterprise#1117.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: trinity-ability <309458136+trinity-ability@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit e0e0306)

* chore(deps-dev): bump the patch-and-minor group across 1 directory with 2 updates (#3856)

Bumps the patch-and-minor group with 2 updates in the /tests/git_sync directory: [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) and [vue](https://github.com/vuejs/core).

Updates `vitest` from 5.0.3 to 5.0.5
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md)
- [Commits](https://github.com/vitest-dev/vitest/commits/v5.0.5/packages/vitest)

Updates `vue` from 3.5.43 to 3.5.44
- [Release notes](https://github.com/vuejs/core/releases)
- [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md)
- [Commits](vuejs/core@v3.5.43...v3.5.44)

---
updated-dependencies:
- dependency-name: vitest
  dependency-version: 5.0.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patch-and-minor
- dependency-name: vue
  dependency-version: 3.5.44
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patch-and-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 990e190)

* chore(deps-dev): bump happy-dom in /tests/git_sync (#4220)

Bumps [happy-dom](https://github.com/capricorn86/happy-dom) from 20.14.6 to 21.0.4.
- [Release notes](https://github.com/capricorn86/happy-dom/releases)
- [Commits](capricorn86/happy-dom@v20.14.6...v21.0.4)

---
updated-dependencies:
- dependency-name: happy-dom
  dependency-version: 21.0.4
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 4c2dab7)

* test: the .env escape table on main has no backend agent_env_patch writer to check (Abilityai/trinity-enterprise#1117)

test_ent1117_s11_env_escape_table.py comes from dev, where it also holds
services/agent_env_patch.py to the shared table. That module arrived on
dev with later feature work and does not exist on main, so its fixture,
its one table test and its one legacy-read assertion are removed here.
Every agent-side and mcp_template check is unchanged.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: trinity-ability <309458136+trinity-ability@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
main carries 7 commits that are not ancestors of dev: the ent#1117 security
back-ports (#4291, #4294, #4314, #4315, #4399, #4400) and the llms.txt refresh
(#4287). Every one of them is already on dev in its original form, so this is a
merge with dev's tree kept as-is (strategy ours). It records main as a parent so
the dev -> main release PR no longer conflicts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@dolho dolho 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.

Verified against live refs (dev aebf5428, main f70ebf6f, head 55014567):

  • Head is a true two-parent merge: parents are exactly the current dev tip and the current main tip, so all 7 main-only commits become ancestors of dev.
  • Head tree equals dev's tree (a3898453) — zero file diff.
  • Re-ran the trial merge (git merge-tree origin/dev origin/main): it conflicts in exactly the five files listed, and outside those five the result is byte-identical to dev. Nothing auto-merged from main is being dropped.
  • In the five files dev is the superset: every package.json range is equal or newer on dev; tests/registry.json has no entry on main that dev lacks; CredentialsPanel.vue and test_ent1117_s11_env_escape_table.py on main are the trimmed back-port forms.
  • The only thing main has ahead is follow-redirects 1.16.3 in the frontend lockfile (dev 1.16.2), as the description says.

Merge commit only — a squash drops the main parent and the release PR conflicts again. Any new commit on main before the cut (e.g. #4179) needs this redone.

@vybe
vybe merged commit 81cd783 into dev Nov 17, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants