Core Concepts
Context Fabric Work Reuse
Work reuse lets the gateway use evidence from an engineering task that someone already completed. That evidence is a work receipt: a record of the changes, the test results, and the repository and branch of the task.
For example, an agent investigates a test failure and records a verified fix. When a later request asks about the same failure, the gateway can add that receipt to the model context, or run the verifier that proved the fix.
Reuse is not a response cache. The gateway still calls the model. It does not replay earlier commands or apply an earlier patch by itself. When it cannot use a receipt, the request continues as a new investigation.
Set up capture and scope first. See Context Fabric Lifecycle.
The decision loop
For each request, the gateway:
- Classifies the task as
exact_repeat,near_repeat,known_pattern_new_location, ornovel. - Searches for a verified work receipt in scope, before it uses broader context recall.
- Selects a reuse mode from the receipt evidence.
- Evaluates the active governance policy for that mode.
- Applies the mode only if the gateway can execute it. Otherwise, it opens a new investigation.
- Records the decision in the response metadata and in audit events.
An earlier answer alone never authorizes reuse.
What a work receipt contains
A receipt can contain:
- The task intent and a normalized fingerprint of the prompt
- The repository, branch, team, and agent scope
- Changed files and symbols
- Commands that can run again, and known error signatures
- A patch summary and the last result
- Verifier or test evidence
- Confidence and verification status
- A link to a newer receipt that replaces it
Verdictan redacts detected secrets and other sensitive values from stored summaries, command previews, and evidence before it stores a receipt. This is an additional control, not permission to store sensitive data. Remove what the receipt does not need before you submit it.
Reuse modes
The gateway selects a mode from the novelty class, the confidence, the scope match, and the policy decision.
| Mode | What the gateway does | Typical case |
|---|---|---|
answer_from_receipt | Adds the verified receipt summary to the request context and calls the model. It does not return the earlier answer. | An exact_repeat task with a verified, high-confidence patch summary |
run_known_verifier | Runs only the known verifier commands of the receipt through the configured local access, and adds the result to the context. | Work with a verifier that can run again, but no safe command reuse |
replay_commands | Recognized by selection and policy, but the gateway changes it to open_fresh_investigation. It cannot replay commands. | An exact_repeat or near_repeat task with commands that can run again |
adapt_previous_patch | Recognized by selection and policy, but the gateway changes it to open_fresh_investigation. It cannot adapt a patch. | A near_repeat task or known pattern with overlapping files |
open_fresh_investigation | Starts a new investigation without reuse. | Novel work, weak evidence, a denied policy, or missing local requirements |
When the evidence is not strong enough for safe reuse, the gateway selects open_fresh_investigation.
Governance boundaries
The gateway applies answer_from_receipt or run_known_verifier without a user action only when all of these are true:
- The receipt is trusted and in scope.
- The active policy allows the mode.
- The confidence is at or above the threshold for the mode.
- For
run_known_verifier, the gateway has local access to run the verifier. - Each verifier action is read-only and has no side effects.
It never applies replay_commands or adapt_previous_patch automatically.
Get approval, or start a new investigation, for work with more risk:
- Destructive commands
- External writes or data export
- Secrets or sensitive policy operations
- Production writes or service changes
- Low-confidence results
- A policy evaluation that is missing or failed
The gateway evaluates policy when it reuses a receipt. The policy that applied when the receipt was captured does not count.
Poisoning defense and scope isolation
When context is old or poisoned, reuse fails closed. Autonomous reuse ignores:
- Receipts in the
stale,disputed,superseded, orconflict_pendingstate - Context outside the active organization, team, repository, branch, or agent scope
- Receipts without the provenance that safe reuse needs
The gateway also:
- Ranks receipts by trust and age.
- Invalidates compiled context packs when a matching receipt or shared context changes.
- Requires verifier commands to pass before a reused path reports success.
- Checks the active policy every time, even if an earlier decision allowed the same action.
Verify reuse
- Send a test request in the same repository, branch, team, and agent scope as a verified receipt.
- Find the
verdictan.work_reuseobject in the response metadata. - Compare
requested_modewithmode. A requested mode can change toopen_fresh_investigation. - Examine
matched_receipt_id,policy_decision, andreason_code, and thenreuse_applied. - If a verifier ran, examine its result and the related events in Trail.
These fields are in the verdictan object of the response:
| Field | Meaning |
|---|---|
context_fabric.novelty_class | The novelty class of the task |
work_reuse.novelty_class | The novelty class that the reuse decision used |
work_reuse.requested_mode, work_reuse.mode | The mode that the evidence requested, and the mode that the gateway applied |
work_reuse.matched_receipt_id | The matching receipt, if one matched |
work_reuse.policy_decision, work_reuse.policy_id, work_reuse.reason_code | The policy result for the requested mode |
work_reuse.verifier_commands, work_reuse.verifier | The verifier commands and their result, if a verifier ran |
work_reuse.reuse_applied, work_reuse.replay_success | Whether reuse and replay succeeded |
Trail records these events:
gateway.work_reuse.policy_decisiongateway.work_reuse.verifier.startgateway.work_reuse.verifier.successgateway.work_reuse.verifier.failuregateway.work_reuse.outcome
The metadata also estimates the tool executions and model calls that reuse saved. If you put these numbers in a cost or reuse report, label them as telemetry estimates. They are not invoice data.
When reuse does not occur
With Context Fabric on, the gateway starts a new investigation when:
- The task is
novel. - The receipt is not in the active team, repository, branch, or agent scope.
- The receipt is not in a trusted state.
- The gateway cannot safely reuse or verify work in the active working directory.
- The active policy denies the action or requires approval.
Next steps
- Context Fabric Lifecycle: capture, scope, search, verification, flush, and purge.
- Human Oversight: require approval for work with more risk.
- Gateway Setup for IDEs: send IDE traffic through a gateway with a defined scope.