Skip to content

feat: inject the framework refusal-reaction baseline into MCPL child env - #79

Open
slimepriestess wants to merge 1 commit into
anima-research:mainfrom
slimepriestess:feat/suppression-baseline-injection
Open

feat: inject the framework refusal-reaction baseline into MCPL child env#79
slimepriestess wants to merge 1 commit into
anima-research:mainfrom
slimepriestess:feat/suppression-baseline-injection

Conversation

@slimepriestess

Copy link
Copy Markdown
Contributor

Second protective-baseline companion per Sol's #architecture spec (8/4 21:54 + 22:09). Depends on anima-research/agent-framework#88 (the REFUSAL_REACTION_BASELINE export) landing and cutting a release; Discord-side precedence/reporting is anima-research/discord-mcpl#19.

What it does

Stdio MCPL children now receive DISCORD_SUPPRESSED_REACTIONS_BASELINE — agent-framework's exported refusal-annotation set, comma-joined — so a never-configured Discord adapter defaults to suppressing exactly the markers this host's framework stamps, instead of defaulting to nothing.

The env composition moves out of the inline finalServers map into composeMcplChildEnv() (mcpl-config.ts) for testability, with deliberate spread order:

  • baseline before the operator spread — an operator who sets the var on the server entry supersedes the house default (including an explicit empty string = "no baseline"; the house value never reappears under an operator's decision);
  • AGENT_TIMEZONE after it — unchanged existing behavior: the agent-facing wall clock is host-resolved per recipe, not a per-server knob.

Injection is unconditional across stdio children (the var is namespaced; non-Discord adapters ignore it) — judgment call flagged for review: detecting "the Discord server" by command string felt more fragile than an inert env var. Standalone Discord without this composition stays honestly unprotected, per "house markers are Host semantics, not universal Discord truth."

Composed-test coverage (Sol's items, host's share)

test/mcpl-child-env.test.ts, 6 tests: injected value round-trips to the exact framework set (split(',') equals REFUSAL_REACTION_BASELINE — this is the AF↔host boundary assertion); injection only when the operator didn't set it; operator value (incl. empty string) preserved verbatim; timezone behavior unchanged; nothing injected beyond the two host-owned keys. Items 3–4 of the composed spec (adapter reports source:"baseline-default" + digest/count, file [] disables, lost config stays stale) are discord-mcpl#19's suite. The cross-repo digest equality has no code-level home (host can't compute the adapter's normalized-set digest) — it's the deployment verification step via filters_get, same as #13's source=file check.

Verification

  • 6/6 new tests + typecheck against the AF branch via the DEV-ENVIRONMENT symlink layout.
  • Against published AF 0.8.0, tsc shows exactly ONE new error — the not-yet-released export (main has 4 pre-existing: 3 tts-relay + 1 mcpl-admin). Goes green with the AF release; happy to bump the dep floor in this PR once the version exists.

(Implementation and this description drafted by Claude at Ra's request.)

🤖 Generated with Claude Code

Host composition serializes agent-framework's REFUSAL_REACTION_BASELINE
(comma-joined) into DISCORD_SUPPRESSED_REACTIONS_BASELINE for stdio MCPL
children, so never-configured Discord deployments default to suppressing
exactly the annotations this host's framework stamps. The env composition
moves into composeMcplChildEnv (mcpl-config.ts) for testability: baseline
before the spread — an operator-set value on the server entry supersedes
the house default, including an explicit empty string — and AGENT_TIMEZONE
after it, preserving the existing host-resolved wall-clock behavior.

Enforcement precedence below this (file key incl. [] beats legacy env
beats baseline; lost config stays stale) is the Discord adapter's, per
the composed-baseline spec; the host owns only that the injected value is
the framework's exact emitted set, below the model line.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant