From daf297f0512dfca56ed80f402ec1c9a5d47c610b Mon Sep 17 00:00:00 2001 From: zengchuang Date: Mon, 23 Nov 2026 04:15:06 +0800 Subject: [PATCH] Document the trusted-host generation feedback boundary Record the accepted first-phase V25 responsibility, distinguish retained-byte identity from feedback authorization, and link the separate Harness enforcement follow-up. Agent-assisted-by: Codex (author) Signed-off-by: zengchuang --- docs/contracts/generation-feedback.md | 55 ++++++++++++++++++++++++++ docs/contracts/schema-and-semantics.md | 9 +++++ docs/operations.md | 1 + 3 files changed, 65 insertions(+) create mode 100644 docs/contracts/generation-feedback.md diff --git a/docs/contracts/generation-feedback.md b/docs/contracts/generation-feedback.md new file mode 100644 index 000000000..696aa4d1b --- /dev/null +++ b/docs/contracts/generation-feedback.md @@ -0,0 +1,55 @@ +# Generation feedback: trusted-host boundary + +This documents the first-phase boundary accepted in +[#371, decision 7084973960](https://github.com/InferMatrixLab/InferRSI/issues/371#issuecomment-7084973960). +V25 assigns frozen feedback policy to Harness. The current +`inferrsi.harness.generation.prepare_generation` does not enforce that policy: +it receives a host-built `candidate_context`, retains the delivered context and +seals the generation plan. There is no automatic next round on this path. + +## What the host must decide + +Before calling `prepare_generation`, the trusted host must establish which +feedback may be delivered under the frozen plan and protocol, and keep final-only +acceptance results out of the next candidate context. + +1. Check the permitted feedback identities and scopes against the frozen inputs. + `CampaignPlan.allowed_feedback` and `ProtocolV1.feedback_visibility` contain IDs; + `CandidateContext.allowed_feedback` contains concrete `ArtifactRef` values. + The host owns the mapping and authorization. H currently provides no production + port that establishes that mapping or filters an assessment for the host. +2. Supply only the approved fixed feedback bytes and references. A complete + `AssessmentRef` or `AssessmentSummary` can contain other claims and scopes; + permission to reveal one check does not authorize forwarding the whole result. +3. Construct `candidate_context.allowed_feedback` from that approved material. + Keep final-only information out of other delivered channels as well, including + task material and context text. An empty feedback list alone does not prove + that other content is free of final-only results. +4. When authorization or scope identity cannot be established, stop the host's + next-generation handoff. Do not infer permission from a successful assessment, + a readable artifact or the absence of an automatic loop. + +The host may show complete retained results to an authorized human reviewer; +that is separate from supplying them to the next candidate generation. + +## What the current ports establish + +Apps `CandidateProvider` checks the declared artifact closure and prepares the +generation specification. H retains the bytes and commits the generation-plan +binding. Those operations establish the identity of supplied material, not that +its feedback contents were authorized by a frozen policy. Apps does not select +feedback visibility, and B continues to own grading. + +Existing function signatures and callers are unchanged. This boundary adds no +policy-reference argument, schema, automatic retry or new enforcement claim. +Policy enforcement is tracked separately in +[#586](https://github.com/InferMatrixLab/InferRSI/issues/586); its detailed reference +and scope-mapping contract must be accepted before implementation. + +## Acceptance wording + +The first-phase #371 acceptance record must describe this as **host precondition, +not proved by H** (宿主前置责任,未由 H 证明). Tests of retained bytes, declared input +closures, or a single generation cannot be reported as proof of feedback-policy +enforcement. V25 remains the architectural requirement; the implementation limit +and its follow-up stay explicit until independently reviewed enforcement lands. diff --git a/docs/contracts/schema-and-semantics.md b/docs/contracts/schema-and-semantics.md index 7c5ff424d..0c9de2d3f 100644 --- a/docs/contracts/schema-and-semantics.md +++ b/docs/contracts/schema-and-semantics.md @@ -112,6 +112,15 @@ Collection rules: `Resource` items are uniquely sorted by role; input collection JSON Schema alone cannot guarantee the cross-reference, authorization, trust-source, and lifecycle invariants above. “The schema passed” is not acceptance of this table; combined acceptance requires both. +**V25 first-phase implementation boundary:** under +[#371 decision 7084973960](https://github.com/InferMatrixLab/InferRSI/issues/371#issuecomment-7084973960), +feedback visibility and exclusion of final-only acceptance information are trusted-host +preconditions, not guarantees established by the current H generation-sealing port. +See the [generation feedback boundary](generation-feedback.md) for host responsibilities +and acceptance wording. Independent H enforcement is tracked in +[#586](https://github.com/InferMatrixLab/InferRSI/issues/586); V25's architectural target +is unchanged. + Harness commits generation inputs in append-only slots keyed by attempt and role. A retry after a generation manifest commit failure uses the same preparation request and provider configuration. Harness reuses the committed delivery, including its bytes and pins, before retrying the manifest commit. The manifest commit also binds the digest of the final execution spec in separate RunStore metadata. A changed preparation request or final spec requires a new attempt. ## 5. Fixed fixtures and current verification evidence diff --git a/docs/operations.md b/docs/operations.md index 1db7ef029..50c34b3c6 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -56,6 +56,7 @@ Effect classes used below: | Verify a frozen preparation binding before registration | Python `inferrsi.harness.prepared_binding.verify` / `read` / `project` | Read-only / pure projection | Fixed ArtifactRef and read-only stream capability; no registration, entry resolution or execution; [binding contract](contracts/harness-prepared-binding.md) | | Freeze a configured P1 preparation | Python `benchmark.preparation.PreparationService.prepare`; [production prepare](contracts/production-prepare.md) | Read-only resource access / pure encoding | Verifies supplied frozen worker/resource bytes and returns a preparation, protocol and role-keyed closure; Apps separately archives them before publishing a Ref | | Assess one fixed P1 record offline | Python `benchmark.assessment.assess`; [production assess](contracts/production-assess.md) | Read-only retained evidence / pure encoding | Verifies the frozen protocol, actual capture and proof bytes; returns independent claims without launching a worker or writing an archive; Apps selects the primary key and archives the result | +| Seal host-approved generation context | Python `harness.generation.prepare_generation`; [feedback boundary](contracts/generation-feedback.md) | Local context / generation-plan retention | The trusted host authorizes feedback and excludes final-only results before handoff. H seals the supplied material; this port does not execute a worker or prove feedback-policy enforcement | | Visualize a recorded run or campaign | CLI `dashboard`; [dashboard](dashboard.md) | Report-generating / local read-only serving | Writes an offline HTML snapshot or serves an optional live view on loopback; does not run an agent or validate a claim | | Capture a knowledge context | CLI `campaign capture-context`; [offline dashboard](dashboard.md#record-the-optimization-story-campaign-trace) | Local evidence-writing | Saves assembled context and resource hashes in a new `knowledge/.json`. Supports ordinary questions and explicit IDs. The only accepted explicit `--relevance-method` value is `find-lexical-v1` | | Retain an executed retrieval | Python `apps.workflows.campaign.save_retrieval`; [capture contract](knowledge-retrieval-trace.md#retain-a-standalone-result) | Local evidence-writing | Saves an existing catalog/collect result under a fresh campaign capture ID; no new search or automatic publication |