Repository navigation
feat: trace per-step knowledge delivery and evidence - #443
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4348fe705
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| identity = {"knowledge_namespace": namespace, "document_id": document_id, "rule_id": rule_id, | ||
| "snapshot_id": snapshot, "document_sha256": document_sha256, | ||
| "section_sha256": section_sha256} | ||
| # An excerpt's section hash is evidence about that exposure, not a new | ||
| # rule identity. The versioned document and exact heading own the identity. | ||
| identity_fields = {k: v for k, v in identity.items() if k != "section_sha256"} |
There was a problem hiding this comment.
Keep reference identities stable when a document hash becomes available
When an adaptive review is followed by read_document for the same page, _trace_adaptive records references with a snapshot but no document hash, while read_document supplies the hash. Including that optional hash in the identity produces two knowledge_ref_id values for the same snapshot, document, and rule. Consequently, the supported document_id/rule_id assessment format fails with assessment requires an unambiguous versioned knowledge reference, and assessing one reference leaves the other incorrectly counted as unassessed. Normalize identity consistently across these delivery paths when the snapshot already pins the document version.
Useful? React with 👍 / 👎.
| event["exposure"] = {**source, **item, "exposure_id": exposure_id, | ||
| "reported_by": "host", "delivery_status": "host_reported"} |
There was a problem hiding this comment.
Attribute host receipt exposures to the receiving step
When a host acknowledges an exposure in a different step—for example, content provided during review.plan and acknowledged during review.source—copying source preserves the provider exposure's step_id. The resulting host-context exposure therefore still reports review.plan, even though its enclosing event and the report's step index identify review.source. This makes the persisted per-step delivery data internally inconsistent and misattributes host-context delivery for consumers using report.exposures[*].step_id. Preserve the source content identity, but set the receipt exposure's step from the receiving event.
Useful? React with 👍 / 👎.
Copilot currently exposes selected knowledge pages and scattered runtime logs, but cannot show which entries each execution step actually received or how a rule check connects to evidence and a decision. This change adds a durable
knowledge-use/1protocol over TraceStore, with separate retrieval, delivery, evidence, assessment, gap, and completion events.Direct SDK/MCP and Strict capture the content crossing their own boundaries, including adaptive context after its cumulative budget is applied. Host receipts and assessments remain explicit declarations; unknown application, native reads, missing evidence, continuation coordinates, and authorized cross-repository capture gaps remain visible. The CLI exports deterministic JSON/Markdown reports and queries repository/rule references. Existing context budgets, feedback consent, and containment permissions stay with their current owners.
The full design is in knowledge_trace.md; usage and configuration are in knowledge-use-trace.md. The bundled
imreviewworkflow records batches before completion validation closes the trace.Validation:
Closes #442.