# Model-facing context

The November 8 admin-DM follow-up eventually returned an expanded implementation
plan, but its captured requests exposed two concrete context defects. The previous
plan was reduced to a 320-character Telegram display preview, while identical shell
results received different observation identities because their archive filenames
changed. The live run repeatedly inspected the same source before answering.

Task runners now receive complete recent conversation messages under a shared
24,000-character presentation budget. The newest oversized antecedent remains
whole and passes through the runner's existing physical-capacity admission.
Current inputs, exact causal sources, attachments and original task ownership keep
their independent protection. Compact routing previews retain their separate role.

Machine bookkeeping belongs in diagnostic records. Model-facing observation
summaries omit fingerprints, receipt IDs, epochs, character counters and duplicate
identity fields. Canonical headings omit internal signal IDs and producer names;
authenticated duplicate receipt displays share one artifact locator. Internal
custody maps, full traces and integrity checks remain available to the host.
Actual source bytes, errors, exit outcomes and functional edit/reopen handles are
preserved. This projection operates on authenticated producer structures and never
searches arbitrary user or tool text for metadata-looking strings to delete.

Raw semantic observation identity is captured independently of behavioral
interventions, before display projection can introduce per-execution filenames.
The closed model-led policy therefore no longer disables factual repeat counting.
Automatic prior-task note/procedure injection and unrelated global Telegram chat
indexes are omitted from action context; their durable stores remain available.
Action prompts also omit the long identity-alias/runtime-configuration dump and
automatic identity-memory instructions. Ordinary conversational identity context
and the host's authorization checks retain their existing paths. Tool paths use
the bound run directory; the unrelated Node process directory is diagnostic data.

Shortening the canonical display also requires binding steering checks to the
actual authenticated physical frame. The selected source signals and original
diagnostic trace remain separate from that display. Tests cover live steering
reconciliation, native tool-call pairing, transport parity and exact file-read
retention.

The longer live replay exposed a further deterministic defect: the same file
body appeared in its native tool result, again in the canonical working set and
again as JSON-escaped text in an append-only host snapshot. The next assembled
request reached 478,686 estimated input tokens and failed admission against a
262,144-token window. Mixed tool batches and edit-precondition wrappers bypassed
the earlier body-retirement checks; source-stripped snapshots had only been used
for accounting, while the full snapshots were actually transmitted.

Selected authenticated native reads now count as source carriers, including
historical and mixed-batch reads. An append-only update carries a complete source
once, then references its actual resident copy. Physical rebases reset residency,
and externally changed files are invalidated before capture. Regression checks
decode host snapshots before counting copies, exercise real mixed native batches
and edit preconditions, and preserve the exact source and pending tool protocol.
When genuine capacity pressure requires demotion, durable receipt custody remains
distinct from a claim that all earlier source is still inline.

The actual HTTP payload exposed another bypass beyond the canonical dump. The
backend added an unrelated controlled-language policy, and strict-provider role
normalization converted later system blocks into `[SYSTEM]`-prefixed user turns.
That placed the quoted old conversation after the current question as a newer
user message. Genuine system blocks now merge into one leading system envelope;
native user, assistant and tool messages retain their exact relative order and
content. Transport, auxiliary budgeting, paging and Nexus do not add default
style instructions. Explicit caller-authored style remains intact.

Byte preservation was still insufficient for the follow-up. The first real wire
request contained only one native user turn: “expand the plan”. Its original
request and prior assistant answer appeared as reverse-ordered JSON quotes in
the system envelope. A later replay completed in ten turns but copied that prior
answer byte-for-byte; passing context and lifecycle checks did not establish
answer quality. The regression now checks exact native user/assistant/user roles
and chronology, and rejects an unchanged prior answer independently of completion.

Verified prior operator-DM messages now carry producer-owned role metadata. The
runner presents them oldest first before the exact current native user turn,
including the distinct anchor used by a cold resume. Their bodies are omitted
from the duplicate quoted carrier. Forwarded messages, other participants,
public groups and history without transport ownership remain attributed source
data. Historical assistant text cannot become a current completion candidate or
grant execution authority. Capacity admission still archives only an oldest
prefix, with exact source readback required before removal.

Live instrumentation must preserve streaming too. The regression harness now
returns the original HTTP response immediately and records a parallel byte-exact
capture. It does not buffer the full response before exposing provider progress.
Its pre-transport audits check decoded source residency and the actual wire roles,
including the absence of an unrequested style policy. Earlier unsuccessful trials
are retained rather than relabeled after these corrections.

The native-role replay then produced a new anchored plan, but its low-level test
configuration omitted both the typed completion contract and native answer
reviewer. It continued after the useful draft and accepted a shorter reply
referring to it. That trial remains failed. A subsequent test through
`TelegramBridge.processTelegramMessageWork` was stopped after its test adapter
failed to intercept streamed tool execution. Its partial role/source checks do
not establish final acceptance or delivery. Full native delivery verification
remains incomplete; the product runner was not relaxed to turn drafts into
accepted answers.

The implementation boundaries are [message role normalization](../packages/backend-vllm/src/messageNormalize.ts),
[source selection and task assembly](../packages/orchestrator/src/agenticRunner.ts),
[append-only source residency](../packages/orchestrator/src/append-only-outbound.ts),
[model-facing metadata](../packages/orchestrator/src/model-facing-metadata.ts), and
[Telegram context and Reply delivery](../packages/cli/src/tui/telegram-bridge.ts).
The source-residency tests decode snapshots and exercise real file tools rather
than relying on a literal search through JSON-escaped payloads.

The [Codex guide](https://developers.openai.com/cookbook/examples/gpt-5/codex_prompting_guide)
describes maintaining useful task state through compaction. Hermes documents a
separate [working-context compression path](https://hermes-agent.nousresearch.com/docs/user-guide/configuration#context-compression)
with durable archived history. Those patterns do not imply that either framework
cannot loop. Our demonstrated defects were more basic: incorrect message roles,
hidden instruction injection and repeated copies of the same evidence.

These changes reduce distracting context; they do not establish that a model can
never repeat an action. The earlier three live cases did not cover this production
follow-up: they used the default large tier and collapsed runner/project roots.
The follow-up harness uses the medium tier, complete preceding conversation and
two distinct isolated roots. Private conversation and source data are supplied
locally rather than committed to the repository.

# Telegram progress

The admin DM's edited Reply message now compounds accepted progress commentary
with short, interleaved `Invoked <tool>` notices. Consecutive invocations of the
same tool share a truthful count instead of pushing the commentary out of view.
The bounded Reply view uses whole recent records, without the expandable quote
of the latest tool output. Activity and Tools retain their exact command/result
records and existing pagination. Raw assistant drafts and hidden reasoning are
not promoted into progress commentary, and this display does not add inference
calls or instructions to the model.

# Verification and limits

All workspace packages build. Focused checks passed: 288 context regressions,
36 native-history/capacity tests, 26 Telegram history-producer tests, 87 backend
tests, 125 Reply/web-transport tests, and 35 replay-harness tests. Six older
presentation assertions were updated for intentionally removed context and pass.
The broader Telegram suite still has 32 failures reproduced against the previous
main commit with identical failure signatures; this is not a full-suite-green
claim.

Real inference used the exact approved
`robit/qwen3.8-27b-obliterated-e03:27b` model through the designated Ollama endpoint
on a physically verified A100. The native-role replay generated a new
3,649-character anchored plan, preserving each large selected source body once.
Its accepted terminal reply did not contain that plan, so the case remains a
failed final-delivery check. Earlier failed trials remain failed. No real
Telegram test messages were sent, and the production daemon was not restarted.

The fresh npm staging build passed the artifact audit and tarball checks for
README wiring, compiled entrypoints and excluded build/test/cache files.
