fix(compression): honor per-style boundaries and add the ponytail safety carve-out - #13938
Conversation
|
A feature é boa e vale ⭐4 isolada. O que segura é o que veio junto. Sobre o título: rodei O defeito 2 confere: Bloqueador — o bloco de base-reds está obsoleto e contradiz o tip. Os 8 arquivos em conflito são todos daquele bloco, e a base já consertou tudo por conta própria com valores diferentes: Fora de escopo: Decisão do dono sobre a feature em si: os Sugestão: dividir em três. (1) a feature de boundaries, rebaseada no tip e sem nada do bloco de base-reds; (2) o |
7ed2735 to
f96c168
Compare
|
Feito — reescopada exatamente como sugerido. Branch resetada no tip Título corrigido — "restore" não se sustenta mesmo: o Swap vs sum → SUM. Bloco de base-reds descartado inteiro (suppressions, stryker, NUL, SVG, fixtures, etc.). Confirmei no tip pristino
Testes: 68/68 nas suítes
|
f96c168 to
bb106e0
Compare
|
Rebasei no tip atual O tip também mudou o placement do instruction: #13383 põe o injection no Confirmei no tip pristino
O |
…ety carve-out The original port (diegosouzapw#7781) omitted the ponytail safety carve-out that upstream ships ('Never simplify away: input validation at trust boundaries, error handling that prevents data loss, security measures, or accessibility basics'). It is not a removal — the clause never existed in the compression catalog. Port it as an exported SAFETY_BOUNDARIES constant on ponytail and less-code, with translations for the 10 style languages. OutputStyle.boundaries was declared but never read (dead field). Resolve it in buildStyleBoundaries(): SHARED_BOUNDARIES is always the base clause and a style that declares boundaries contributes its own clause on top, deduped, in catalog order. The two ADD rather than replace so a code-shaping style never loses the shared guarantee (e.g. 'keep code blocks, file paths, commands, errors, URLs exact'). A style that declares nothing (terse-prose) stays byte-identical to the legacy instructions + SHARED_BOUNDARIES injection (D-A5); per-(selection, language) output is static and prompt-cache stable (D-A4).
bb106e0 to
31a5008
Compare
|
Rebaseado no tip atual Confirmei num checkout pristino do tip novo que todos os base-reds que o PR herdava sumiram:
Localmente no branch rebaseado: 72/72 nas suítes |
placeSystemInstruction() appends the styles block after the existing system text, or as a trailing system message, and never creates a new messages[0]. The JSDoc said the styles were front-loaded into the system prompt.
5cb5593
into
diegosouzapw:release/v3.8.51
Summary
Two output-style defects, feature-only scope. This is split (1) of the three you proposed.
Rebased on the
release/v3.8.51tip3ee283bb9. 1 commit, 5 files, merges clean.The blocker you flagged is resolved
You were right that the base-reds block was obsolete and contradicted the tip. Verified on a pristine checkout of
3ee283bb9:check:api-typecheck: OK, 283 pre-existing, within baselinecheck:env-doc-sync: in syncgenerate-agent-skills: 46 skills, nothing to generatemutation-test-coverage: no driftEvery check green on the tip stays green with this PR applied.
Defect 1 — the ponytail safety carve-out was omitted by the original port
git log -S"simplify away" --allagrees with your finding: the clause only ever lived inskills/ponytail/SKILL.md. It is an omission from port #7781. Ported as an exportedSAFETY_BOUNDARIESconstant onponytailandless-code, translated across all 10 style languages.Defect 2 —
OutputStyle.boundariesdeclared but never readDead field at
outputStyles/catalog.ts:19, now resolved inbuildStyleBoundaries()(outputStyles/apply.ts).Your swap-or-sum question: SUM.
SHARED_BOUNDARIESstays the base clause and a style's ownboundariesis appended on top, deduped, in catalog order, so a code-shaping style keeps "Code blocks, file paths, commands, errors, URLs: keep exact". A style declaring nothing (terse-prose) stays byte-identical to the legacy injection (D-A5, pinned by test). Per-(selection, language) output is static and prompt-cache stable (D-A4).Title fixed too: "restore" is gone, since as you showed there was no deliberate removal to revert.
Scoped out at your request
auth.ts: you asked for it as its own PR. It turns out to need none. The tip already reconciles fix(sse): keep unavailable forced connections scoped #12080 with fix(sse): say when an API key's allowlist is what hid every connection #13879/fix(auth): "No active credentials" hides that the API key's connection allowlist excluded the provider #13832 on its own, so the!forcedConnectionIdgate is moot (sse-auth+chat-helpers= 97/97 on a pristine tip).My own carve-out, for your call
Every style's effective instruction gains a boundary clause, so the first request after deploy re-pays the system-prompt cache per (style, level, language).
Testing
output-styles-*,ponytail-catalogandi-have-adhd-catalogon the rebased branch.output-styles-boundaries.test.ts: sum semantics, dedupe, catalog order, localization, determinism, byte-identity anchor. The injection helper reads the top-levelsystemplacement from fix(compression): place output-style instruction in top-level system, not messages[0] #13383.npm run typecheck:coreclean,check:mutation-test-coverageno drift.31a5008: Quality Gates, semgrep, API Route Typecheck all pass.tests/unit/compression/runs under node:test, not vitest.