# Writing channel packs

`applyWritingChannel` is an opt-in wrapper around `applyWritingConsumer`. It resolves the same project, session and invocation output modes, including stored `writer-<id>` profiles, and selects the built-in `channel-<channel>` structure mode. Conflicting structure modes fail under the existing resolver contract. A parsed shared brief preserves claim evidence and permissions across article, social, email, engineering and conversation targets. The channel is passed as the writer-profile task scope, so accepted preferences and overrides for `article`, `social`, `email`, `engineering` or `conversation` apply only to that channel. Channel selection takes precedence over a generic consumer `task` value; it does not persist profile changes. Packs change expression guidance, never evidence confidence. They are advisory, including engineering guidance; they make no standards certification claim.

Supply `channel`, `brief`, the ordinary consumer request, optional constraints and a `transform(content, mode, {pack, brief})` callback. The callback receives each resolved mode through the existing runtime, including protected-literal placeholders; preserve those placeholders. Explicit `constraints.requiredLiterals` and `constraints.cta` are included in that protection, together with any caller `runtime.protectedLiterals`. A complete CTA is therefore hidden as one protected span, including nested inline code or identifiers. Only occurrences already in the input are protected; absent required text is not fabricated. Final channel checks still apply after restoration, including the one-CTA rule. Samples and brief text are data. A changed candidate requires the runtime fidelity checks and an explicit passing `runtime.validateFinal` reviewer. An uncertain or failing reviewer retains the original. This API neither supplies a model nor verifies reviewer independence or factual truth. With no callback, it exports instructions and claims no provider interception. Structured outputs remain unchanged; callers must explicitly select a prose field first.

`channelCheck` reports mechanical constraints on the returned content. `posts` contains exactly one string for eligible prose or is empty if the returned original also violates constraints. It is never publication approval. `constraints.maxCharacters` is a positive caller-supplied limit counted in Unicode code points, including Markdown syntax. It is not a current platform limit or a platform-weighted counter. Use a destination-specific validator where required. `requiredLiterals` retains exact technical terms, caveats, links and qualifications; `forbiddenLiterals` rejects specified internal review wording. These checks are literal, not semantic duplicate detection or proof of complete caveat coverage.

Telegram/Discord require the social pack and a nonempty exact `cta`, occurring exactly once in the same string. There is no separate engagement record. A failed limit or literal check returns the original with empty applied/validated receipts, or throws with `onFailure: 'fail'`. It never shortens output to fit. A valid fallback original can be returned as one post, with fallback still reported. Callers must inspect fallback, channelCheck and their ordinary approval state before handoff.

| Pack | Expression guidance |
| --- | --- |
| Article | Supported detail and useful headings; optional ending without a required recap |
| Social | Self-contained announcement with nearby limitations and same-post CTA |
| Email | Clear purpose and requested action; optional greeting and signoff |
| Engineering | Technical terms, commands, advisory qualifications and uncertainty retained |
| Conversation | Direct complete thoughts; no first-paragraph truncation or forced fragments |

## Consumer coverage

This matrix covers every row in `.aiwg/working/voice-2292/consumer-audit.md` at the audited source revisions. It is not a claim that every repository or provider consumer has been discovered or intercepted. An instruction handoff requires the consumer/operator to apply and review it; importing a module alone does not activate it.

| Audited consumer and paths | Implemented route / validation | Remaining limitation |
| --- | --- | --- |
| Voice application: `voice-framework/skills/voice-apply/SKILL.md` | Shared profile and channel instruction export; API available to participating callers | Prompt execution is not automatic provider interception |
| Analysis/create/blend: `voice-framework/skills/{voice-analyze,voice-create,voice-blend}`, Python scripts, `voices/templates/*.yaml` | Explicit legacy attachment import preserves original format; writer sidecar compilation is separate | Legacy analysis is not evidence of author identity; channel guidance requires handoff |
| Writing validation: `src/writing/{validation-engine,pattern-library,validation-rules,patterns}`, writing-quality agent, AI-pattern skill/Python | Contextual diagnostic API and labeled fixture evaluation | Older prompt/Python consumers require explicit diagnostic handoff; pattern scores do not qualify human voice |
| Other writing transformations: `src/writing/{prompt-optimizer,prompt-templates,content-diversifier,example-generator,voice-analyzer,voice-calibration}.ts` | Explicit instruction-export fallback | No automatic channel wiring or generated-example quality claim |
| Articles: marketing `agents/{content-writer,copywriter}.md`, `templates/content/blog-post-template.md` | Updated shared-brief handoff and optional ending; article API tested | Prompt/template guidance alone is not runtime validation |
| Social: `agents/social-media-specialist.md`, `skills/social-strategy/SKILL.md`, `templates/social/social-post-template.md` | Social API checks one-post CTA, literal preservation and explicit budget; agent/template updated | Strategy skill remains instruction handoff; platform-specific limits must be supplied/validated |
| Email: `agents/email-marketer.md`, `skills/email-campaign/SKILL.md`, `templates/email/{email-campaign-template,transactional-email-template,nurture-sequence-template,email-template-spec}.md` | Email API and updated agent handoff | Campaign skill/templates are explicit instruction fallback; no mail sending integration |
| Brand: `templates/brand/{voice-tone-guide-template,brand-guidelines-template}.md` | Explicit handoff separates controlled brand requirements from author preferences | Brand documents are not inferred writer identity; no automatic import |
| PR/provider launch: `skills/pr-launch/SKILL.md`; Strategy `provider-marketing/{references/provider-launch-contract.md,flows/provider-launch.playbook.yaml,agents/provider-channel-editor.md,agents/provider-launch-orchestrator.md}` | Upstream PR skill handoff updated; documented adapter below | External Strategy files unchanged; publication qualification and approval remain external |
| Neuroframing: Strategy `neuroframing-voice-theme-adapter`, `neuroframing-{blog-post,social-thread,outbound-sequence,campaign-packet,content-system}` skills | Explicit instruction adapter separates rhetorical technique, writer preferences and supported claims | No copied implementation or automatic integration |
| Social publication: Strategy `prepare-social-dataset`, `publish-social-{post,thread}`, `references/post-record-contract.md` | Manual/instruction handoff only | Existing two-record announcement+engagement contract conflicts with this one-post requirement. Unsupported until external adapter changes; never claim this API repairs that publisher |
| Concierge: `tools/daemon/concierge/response-translator.mjs`, daemon `concierge.behavior.md`, `agents/concierge.md`, `behaviors/concierge/BEHAVIOR.md` | Opt-in conversation API or explicit instruction export | Legacy first-paragraph truncation and “Never hedge” behavior are not fixed here; raw-output bypass/participating consumer required |
| Provider launch runtime: `src/cli/handlers/run.ts`, `src/output-modes/runtime.ts` | Shared resolver/runtime and explicit `applyWritingConsumer` callback, tested by consumer suite | Environment selection/export is not evidence a provider applied instructions; caller labels are not verified execution identity |

External Strategy adapters should map verified claims and limitations to the shared brief, retain campaign intent separately, attach legacy voice profiles explicitly, and call final validation on channel output. Preserve publisher approval, idempotency and checksum contracts. No external strategy code was copied or modified. Resolving the incompatible two-record publisher contract is a separate change in that repository.

## Pilot and validation scope

`test/fixtures/writing/channel-pilots.v1.json` pins OMP and Antigravity article hashes and exact source-excerpt hashes. The proposed chat edits replace a rhetorical quiz and internal campaign review language, retain experimental/support limits beside the preview action, and include the CTA once. They are developer-proposed excerpts awaiting author review, not author-approved outputs, full article rewrites, republished campaigns or live model runs. Source URLs and commands in these drafts describe pinned historical evidence, not freshly verified provider behavior.

Run `npx vitest run test/unit/writing/writing-channels.test.ts`. Tests exercise a deterministic article-to-social-to-email formatting chain and all five channels with two explicitly configured profiles and one shared brief, exact byte preservation without a callback, structured-output bypass, missing final reviewer, character-budget failure, same-post CTA, Unicode counting, Markdown link restoration and technical/advisory literal retention. The pilot checks verify hashes and declared constraints. Deterministic callbacks demonstrate delivery and constraint behavior; they do not evaluate stylistic quality, author recognition or a model-generated article-to-social-to-email chain. Real author-reviewed channel outputs and platform publication integration remain required for those acceptance criteria.

The [paired Qwen/GPT-OSS development run](evidence/channel-model-comparison-2026-09-07.md) exercised twenty matching prompts and the same runtime. Neither model had a joint fidelity/cadence/mode pass. Those failures limit qualification; the channel APIs and deterministic constraints are not proof of natural writing quality.

The callback context still contains the original brief for the consumer to use. When constructing a model prompt from masked transform text, encode or omit duplicate raw representations of protected values in other fields. The development pilot exposed social CTAs twice through a masked source and a raw `constraints.cta`; preserving each marker did not prevent an extra raw CTA. Final multiplicity checks correctly rejected those outputs. Masking is a transformation aid, not data-access isolation.

The [explicit-literal development pilot](evidence/channel-literals-development-2026-09-07.md) records the combined masking intervention and the remaining duplicate raw CTA representation. It improved factual retention in that paired pilot without yielding any joint voice pass.

A [paired core-guidance handoff study](evidence/core-guidance-development-2026-09-07.md) supplied the existing JDS/Darwin companion guidance that the coarse JSON controls cannot encode. It did not establish a voice-quality gain and reduced factual passes in that development slice. Supplying more descriptive guidance is not a qualified remedy by itself.

The [TinyStyler mechanism trial](evidence/tinystyler-development-2026-09-07.md) and [bounded expression-edit comparison](evidence/expression-edits-development-2026-09-07.md) did not establish joint voice passes. Paragraph-range addressing improved proposal applicability on four follow-up cases; factual and cadence review remain separate obligations.

Current-model evaluation follows the [model eligibility record](evidence/model-eligibility.md). GPT-OSS20b reports are historical debugging evidence and do not qualify current model-family coverage.

The [current Qwen/Gemma expression study](evidence/current-model-expression-2026-09-07.md) records three primary-reviewed Qwen joint passes, remaining semantic failures, and Gemma edit-format failures. It does not establish full channel qualification.
