Repository navigation
Conversation
A memory file can name the transcript rows its facts came from in one frontmatter line, sources: [<workspaceId>:<itemId>, ...]. The pure module parses, merges (dedupe, newest 16 kept) and rewrites that line, and resolves the memory tool's sources input (self:<itemId>, project-scope check).
Harvest and dream writes pass rejectSecretLike; the agent-facing memory tool did not, so an agent could copy a token from tool output into project or global memory that other workspaces' models read. Also gives the experiment gating test the workspace id and history that session_history (registered with Agent Memory since the project history index) requires.
create, str_replace and insert take an optional sources list. self:<n> names the caller's own transcript; any other workspace must be in the caller's project history scope. MemoryService merges the citations into the file's frontmatter sources: line inside the mutation lock. A caller that resolved no sources (harvest, refine) refuses them instead of dropping them. The static memory guidance asks for sources on facts that come from a transcript.
Dream runs get a read-only history tool (read and search through the project history index) bound to the consolidated workspace's project; a run without a project identity gets none. A single-row read reports source_status (resolved, missing, workspace_removed, out_of_scope, unchecked). The dream may cite only rows it read and found, history calls share the run's step ceiling, and each applied op's journal note lists the file's citations and what the run found for each, since the dream's transcript is not stored. dream.md says how to act on each status.
A create, str_replace or insert whose text added entries to the frontmatter sources: line skipped the checks the sources parameter gets, so an agent could cite another project's workspace and the dream could cite rows it never read. MemoryService now checks, inside every text write and its dry run, each entry the edited file holds that the file before did not, together with the sources input, through the writer's own check (checkSources): the interactive tool's format, project scope and self: resolution; the dream's rows read and resolved this run. A writer without one (harvest, refine) adds no citation. Removing entries and carrying them over stay free. A citation copied into another file counts as added, so dream.md now says to read it first.
createConsolidationMemoryTool built the secret guard and the new source check twice, once for the dry run and once for the write, and the crap gate counted the extra decision (CC 16 -> 17). One writeRails() now builds both, so a preview refuses what the write would.
…idance's sources line
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Codex Review Summary: ✅ CompletedThis 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: b8bc78f627
ℹ️ 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".
|
@codex review |
🟢 e2e stories (Haiku): 14 passed21 agent steps · 6 replayed from cache · 15 model calls · 47.7k tokens (27% cached) All 14 tests in 9 files
e2e 0.20.0 · 1m 22s · web · run artifacts 🟢 e2e Electron stories (Haiku): 3 passed3 agent steps · 3 model calls · 7.9k tokens (33% cached) All 3 tests in 3 files
e2e 0.20.0 · 24.0s · electron · run artifacts 🟢 e2e agent repros (Haiku): no tests selectedSpend: $0.00 of the $1.00 cap (proxy ledger) e2e 0.20.0 · 8.0s · 2 targets (web, phone) · run artifacts |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
withSourcesLine read the sources value line by line and left a flow list's closing ] behind when it stood on its own line. The span now comes from the YAML parser (key start to value end); the line logic stays as the fallback for frontmatter that does not parse. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
@codex review |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf181b2cb4
ℹ️ 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".
…y row a read returned An empty sources key with a comment (sources: # note) has a value range that ends at the comment, so the span now drops all trailing whitespace, not only newlines. The dream's ledger recorded only from_item; it now records each row a successful range or cursor read returned. --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 214f6a7cc6
ℹ️ 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".
| index: DreamHistoryIndex | ||
| ): SourceCheckStatus { | ||
| if (!result.success) return failedReadStatus(source, result.error, index); | ||
| if (result.parts?.some((part) => part.item_id === source.itemId) === true) return "resolved"; |
There was a problem hiding this comment.
Keep citations distinct across history clears
After a workspace's history is cleared and new messages arrive, an existing citation can resolve to an unrelated replacement row. HistoryService.truncateHistory() resets the sequence counter to zero on full clears, but citations persist in memory files and this check treats any matching item_id as the original source. For example, a saved a1:0 citation becomes resolved against the first message after /clear, allowing the dream to validate or correct an old fact using the wrong evidence rather than recognize its source as missing. Preserve a non-reusable row identity across clears, or otherwise distinguish the transcript generation in persisted citations.
Useful? React with 👍 / 👎.
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
Memory files can cite the transcript rows their facts came from (
sources: [<workspaceId>:<itemId>, ...]in frontmatter). The dream (memory consolidation) gets a read-onlyhistorytool, so it can check cited facts against those rows and newer ones before it keeps, fixes or drops them. Interactive memory writes now refuse credential-like text, as harvest and the dream already did. Stacked on #8224.Background
No memory entry linked back to its evidence, and the dream rewrote facts without ever seeing a transcript. Anthropic's write-up on dreaming reports that its value comes from correcting notes against the original transcript. Citations make a fact checkable.
Implementation
memorySources.tsis the one pure module that parses, formats, merges (dedupe, newest 16) and resolves citations. The line is plain YAML, so old builds keep it through edits. Only numeric item ids are accepted, because the index is keyed by history sequence.sourcesoncreate,str_replaceandinsert.self:<n>resolves to the caller's workspace. Any other workspace must be in the caller's project scope.checkWriteSourcesruns inside every write and compares the citations before and after it. Each added citation passes the caller's check, whether it came through the parameter or through the text: the project scope for agents, "read and resolved this run" for the dream, and refusal for harvest and refine. Removing a citation stays free.historytool (read,search) is bound to the consolidated workspace's project. Its calls count against the run's step ceiling. Each applied op's note records which sources it checked.Validation
9679e9d193keeps thesources:line throughstr_replace,insertandrename.sources: [<sibling>:1].Risks
sources. The value of this PR rests on the dream check and on future prompting.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$49.27