Skip to content

feat(inference): add reversible operation input encoding - #2314

Merged
hidb4ai merged 7 commits into
codex/pr2264-inference-protectionfrom
codex/pr2264-input-encoding
Nov 1, 2026
Merged

hidb4ai merged 7 commits into
codex/pr2264-inference-protectionfrom
codex/pr2264-input-encoding

Conversation

@hidb4ai

@hidb4ai hidb4ai commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Implements the operation input-encoding portion of RFC #2086. Replaces the corresponding scope of #2264.

Depends on #2311 and targets its branch so this diff contains only this feature. After #2311 merges, rebase onto master and retarget before marking this PR ready; do not merge into the feature base branch.

Rationale for this change

Repeated evidence and metadata can inflate model inputs. Reversible encoding can share repeated values while preserving the exact stage JSON and its evidence identities. Selection must remain bounded, use the same representation as budgeting, and never turn a privacy rejection into an encoding fallback.

What changes are included in this PR?

  • Add bounded shared-json-v1/v2 codecs with exact reconstruction and off/shadow/active selection for Atomic Memory extraction/reconciliation and Experience generation/incubation.
  • Preserve original inputs for unsupported shapes, insufficient savings, and custom Artifact Prompts; check original and selected content under enforcing protection.
  • Align Atomic Memory budgeting and rendering. Carry configuration into real workers and preserve current main's processing diagnostics.
  • Attach invocation-local encoding estimates to usage reporting while keeping actual provider usage and persistent counters separate. Add bilingual operating documentation.

Are there any user-facing changes?

Encoding defaults to off and adds no model calls, HTTP endpoints, database tables, or migrations. Active encoding is experimental: exact reconstruction and local size estimates do not prove equivalent model quality or lower provider cost. Active candidates reach the model as encoded envelopes; shared values still contain the original evidence and provide no privacy redaction. Literal placeholders are not resolved. The bilingual guide defines model/workflow acceptance for ownership, paths/IPs, types, repeated occurrences, tool intent, and persisted facts. Each operation/model combination needs its own acceptance.

How was this change tested?

  • Focused codec, preparation, runtime, worker, and usage regressions passed, including both codecs preserving literal markers, distinct entity/Source attribution, object versus JSON-string types, and Atomic Memory descriptions. Existing off/active budget-boundary assertions remain unchanged.
  • make check: passed, including lint, types, locks, and integration manifest checks.
  • Controlled providers were used; Python round trips and fixed model responses establish representation/workflow behavior, not real-model decoding or semantic equivalence. No live provider A/B quality or billing evaluation is claimed. The separate evaluation PR test(evaluation): measure Experience input encoding quality and cost #2315 supplies that workflow.

AI usage statement

OpenAI Codex assisted with implementation organization, conflict resolution, regression tests, documentation, and validation.

@AlexStocks AlexStocks added the 1.5.0 v1.5.0 release tracking label Oct 30, 2026

@hireview001 hireview001 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hidb4ai
hidb4ai merged commit 6cec247 into codex/pr2264-inference-protection Nov 1, 2026
1 check passed
hidb4ai added a commit that referenced this pull request Nov 2, 2026
…2311)

* feat(inference): enforce final request and response privacy checks

* feat(context): add exact reuse proofs and final payload admission

* test(inference): preserve privacy admission content

* docs(context): define admission boundaries for transformed values

* test(inference): adapt privacy recovery fixtures to memory descriptions

* build(opencode): refresh combined API operation bundles

* test(desktop): qualify synchronized context Server protocol

* fix(inference): close worker and opaque carrier privacy gaps

* fix(context): reject prepared markers split across text blocks

* fix(context): enforce permit deadlines throughout request writes

* fix: align main upgrade review and test fixtures

* test(desktop): qualify synchronized context Server protocol

* test(desktop): qualify synced context reuse server

* feat(inference): add reversible operation input encoding (#2314)

* feat(inference): add reversible operation input encoding

* docs(inference): clarify input encoding semantics and acceptance

* fix(context): defer crypto imports and check merged Anthropic turns

* test: align processing diagnostics fixture with input encoding

(cherry picked from commit 20b3b4c)

* fix(tests): resolve SeekDB probe imports consistently

(cherry picked from commit 19a1c11)

* fix(inference): preserve stream identities and refused usage

* test(desktop): qualify merged context receipt contract

* refactor(inference): remove unused Atomic Memory encoding wrappers

* fix(inference): inspect assembled Responses output text

* fix(inference): validate Chat stream root model identity

* docs: require coordinated context capability client upgrades

* fix(inference): preserve provider retries in observation modes

* fix(inference): preserve completed sibling privacy refusals

* fix(server): reuse the prepared context admission limit

* docs(inference): clarify enforcing response buffer limits

* test(evaluation): measure Experience input encoding quality and cost (#2315)

* feat(inference): add reversible operation input encoding

* test(evaluation): measure Experience input encoding quality and cost

* docs(inference): clarify input encoding semantics and acceptance

* test(evaluation): probe model interpretation of encoded evidence

* fix(evaluation): guard identities and isolate failed cases

* test: align processing diagnostics fixture with input encoding

* fix(evaluation): preserve judge streaming and evidence identity

* fix(eval): reject missing external databases before runtime startup

* fix(eval): normalize partial database configuration

* fix(eval): reject unsupported private identity platforms

* fix(inference): guard SDK assembly and evaluation resume identity

---------

Co-authored-by: hireview001 <1441951127@qq.com>
@hidb4ai
hidb4ai deleted the codex/pr2264-input-encoding branch November 3, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.5.0 v1.5.0 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants