larry-zy commented on issue #1539:
URL: https://github.com/apache/dubbo-admin/issues/1539#issuecomment-5778304014
The next phase of context engineering should provide an extensible, secure,
and measurable pipeline for assembling
model inputs. Each context source should have explicit permissions,
provenance, freshness, lifecycle, and token
limits. The implementation should use project-owned interfaces without
integrating PowerContext. Reviewing the
design document also highlights requirements that need explicit coverage:
shared security controls, storage limits,
evidence precedence, memory deduplication, and deletion of derived data.
1. Unified Context Compiler
Define extensible context-source interfaces and assemble authorized
sources into model inputs. Record included
and omitted items with reasons, support bounded historical queries, and
prioritize fresh tool evidence over
historical summaries or memory.
2. Versioned Prompt Templates
Support template variables, message roles, versioning, and backward
compatibility. Restrict available variables
and functions, validate required inputs, and prevent user-controlled
values from changing message roles or tool
permissions.
3. Server-Side Page Context Validation
Validate snapshot structure, size, allowed fields, and resource
permissions. Redact sensitive data, limit
snapshots to the current interaction, and verify current resource state
through live tools.
4. Session Ownership and Access Isolation
Derive tenant and user identity from server-side authentication.
Enforce ownership and resource permissions
across session APIs, chat requests, history retrieval, and deletion.
5. Shared Context Security and Sensitive-Data Controls
Apply consistent trust boundaries and redaction across page context,
tool results, summaries, memory, and RAG.
Treat external content as untrusted data and prevent secrets from
entering persistent memory, indexes, or logs.
6. Request Idempotency and Session Lifecycle
Prevent duplicate interactions on retries, define concurrent-write
behavior, and support configurable retention
and cleanup. Bound in-memory session counts, event counts, and total
storage size; propagate deletion to derived
data and pending background work.
7. Token Budgets and Tool-Result Compression
Reserve output capacity and a safety margin, allocate budgets by
source, and trim deterministically without
breaking tool-call/result pairs. Compress large results into structured
evidence with authorized references, and
return explicit errors when mandatory content alone exceeds the budget.
8. Token Usage Attribution and Cost Accounting
Distinguish pre-call estimates from provider-reported usage and track
estimated consumption by context source.
Aggregate usage across agent iterations, retries, and auxiliary model
calls such as summarization; calculate
auditable costs using versioned pricing and explicitly mark unknown
costs.
9. Conversation Summarization
Generate structured summaries containing goals, confirmed facts,
evidence, completed actions, unresolved work,
and superseded conclusions. Track source ranges and versions, protect
concurrent updates, and support continued
conversations beyond fixed turn limits with bounded fallback when
summarization fails.
10. Long-Term Memory Creation and Management
Support confirmed memory facts, candidate extraction, deduplication,
and replacement of outdated facts. Provide
controls to view, confirm, edit, delete, clear, expire, and disable
memory, with traceable provenance and
cleanup of derived copies.
11. Long-Term Memory Retrieval and Injection
Begin with structured-key and keyword retrieval. Apply permission and
scope filters before ranking, then enforce
confirmation status, validity, relevance, and token limits; historical
memory must not override current
authoritative evidence.
12. Evaluation, Observability, and Controlled Rollout
Evaluate multi-turn reasoning, long conversations, memory corrections,
access isolation, prompt injection,
deletion, and failure recovery. Record privacy-preserving metrics and
version identifiers, provide independent
feature flags and rollback, and retire legacy paths after validation.
13. Vector Retrieval Extension
Introduce pluggable vector indexing when evaluations demonstrate a
benefit. Enforce authorization during
retrieval, synchronize updates and deletion, and keep the index
rebuildable from canonical memory records.
14. Authorized RAG Evidence and Genuine Reranking
Integrate RAG as a context source with collection permissions,
provenance, document versions, and retrieval
scores. Implement actual reranking, enforce evidence budgets, and allow
basic conversation to continue when
retrieval fails.
15. Declarative Skills and Task-Specific Assembly
Implement versioned Skill manifests, registration, and deterministic
selection. Load task instructions,
examples, and permitted tools or knowledge sources within the caller’s
permissions and token budget; Skills must
not override core security policy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]