Repository navigation
feat(sources): checked, credited and undoable Library writes - #823
Open
yaacovcorcos wants to merge 1 commit into
Open
yaacovcorcos wants to merge 1 commit into
yaacovcorcos wants to merge 1 commit into
Conversation
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
yaacovcorcos
force-pushed
the
claude/sources-agent-trust-20261110
branch
2 times, most recently
from
November 11, 2026 02:39
8e2cb6a to
0eaf62f
Compare
yaacovcorcos
added a commit
that referenced
this pull request
Nov 11, 2026
…he click The read-mode citation test clicks by coordinates. In a CI shard, earlier tests left the editor below the viewport, so ProseMirror found no position and the click was ignored (Test Web 5 on PR #823). Reproduced locally by pushing the editor below the fold; scrolling it into view first, as view.browser.test.ts does, fixes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yaacovcorcos
force-pushed
the
claude/sources-agent-trust-20261110
branch
3 times, most recently
from
November 11, 2026 15:15
3d717e9 to
c7744de
Compare
… Sources roadmap streams One commit on main ef51507 with the tree of claude/sources-combined-20261110 at f3828bc plus its Accounts seam-map entry a6d25ea (full history, with each stream's merges, stays on that branch). - Phase 1: identifier-checked agent writes (doi.org, PubMed), updatedBy credit, review gate removed, trash, restore, revert, robust listing, contact email, retraction and correction status, re-checks. - S2 citing and managed references.bib/json, S3 arXiv/ISBN and Add by identifier, S4 BibTeX/RIS/CSL-JSON/EndNote import and export, S5 reference check, S6 Zotero, S7 papers filed as Sources, S8 full-text search and quote checks, S9 PDF annotations, S10 collections, tags, saved searches, bulk edit with Undo and systematic reviews. - Client permission gating for Library HTTP mutations, a trimmed agent tool list, Library header and reference-box fixes, work-log names for the new tools, and React Compiler-safe busy-state handling. - Paper requests that file or attach a source (Get PDF, library requests) now need the same Library permission as the Sources routes, checked by one rule on client and server. - Fixes from live lookup checks: old-style arXiv IDs with a subject class, Open Library authors named twice, and Crossref titles with inline markup read as plain text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
yaacovcorcos
force-pushed
the
claude/sources-agent-trust-20261110
branch
from
November 11, 2026 15:28
c7744de to
d7d239c
Compare
Contributor
Author
|
Superseded by #881, which carries this PR's agent-trust work together with the rest of the Sources stack (M2 and the personal Library), squashed onto current main and gated together. Leaving this open for the owner to close. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Library (Sources) writes could not be trusted or undone.
scient_sources_review, so the review protected nothing. Agent edits were recorded as the user's.Resulting behavior
Checked writes (Phase 1, PR 1).
identifier-not-foundandidentifier-mismatch(registry title differs from the agent's) write nothing; a confirmed identifier makes the registry's citation fields authoritative and storesverified; an unreachable registry adds the source as given withunchecked; no identifier isunverified. The same add path serves a person adding by identifier (actoruser).scient_sources_reviewtool, route or buttons. Olderpendingrecords still decode.updatedBy(useroragent); changed fields get agent provenance.Undo (Phase 1, PR 2).
.scient/sources/trash/; its PDFs stay. The UI removes straight away and offers Undo in the toast (the confirmation popover is gone); Trash in the Library header's⋯menu restores sources or empties the trash. Restore writes a new revision credited to whoever restored it and refuses over a live source with the same ID or identifier. Emptying deletes trashed sources, their history and only PDFs that no live or trashed record refers to, and deletes no file while any record cannot be read. Detaching a PDF also keeps the file until the trash is emptied.scient_sources_restore,scient_sources_revert,scient_sources_listwithinTrash,scient_sources_removewithpermanentfor a trashed source, and kept revisions (who saved each, which fields changed) inscient_sources_get.Robustness and registry data.
prism:coverDate/prism:publicationDate, never the file'sCreationDateordc:date.api.crossref.organdapi.openalex.org, including redirect hops from doi.org, carry it asmailtoand in a versioned, descriptive User-Agent; no other host receives it. Other adapters read the same value.editorialStatusfrom Crossref'supdated-bynotices in the same doi.org response (publisher updates and Retraction Watch); a PMID from PubMed'sRetracted Publicationtype. The most serious notice sets the state (retracted, withdrawn, expression of concern, corrected, or none). The source shows one quiet line with a link to the notice and the Library row names it;scient_sources_addandscient_sources_listreport it.scient_sources_checkand every metadata refresh re-resolve a source's identifier without touching its metadata:verifiedwith fresh editorial status,unverifiedwith anot-foundormismatchproblem (shown as "Not found in registry" / "Identifier names another work"), oruncheckedwhen the registry is unreachable (an earlier verdict for the same identifier stays). A check that changes nothing writes no revision. Editing identifiers clears both verdicts.reviewRequiredis no longer sent for source imports, and the review tool's work-log name is replaced by names for the new tools.All new record fields are optional; existing
.scient/sourcesdata decodes unchanged andformatVersionstays 1.Also in this branch. Following the overnight Sources roadmap work plan, this PR also carries the Phase 2–5 streams. It is one commit on main
ef51507463with the tree ofclaude/sources-combined-20261110atf3828bc76cplus that branch's Accounts seam-map entry forsourcesPermissions.ts(a6d25eabba): the stream merges failed the upstream-provenance check, so the history was squashed. The full history, with each stream's commits and merges, stays on that branch. Each was reviewed by Codex until clean; reviews and responses are in the plan folder (reviews/sources-roadmap-20261110/reviews/).[@citations in Markdown, the LaTeX citation dialog lists Library sources, managedreferences.bib/references.jsonthat never overwrite hand edits, Word export in a CSL style, and a pre-cite check for agents.scient_sources_addlists of mixed identifiers; a Library awareness block and tool hints for agents.scient_references_checkand "Check references" for.md,.tex,.biband the Library (wrong or non-resolving DOIs, DOI naming another paper, retractions, preprints with a published version, missing fields), and a built-inreferencesskill.scient_paper_getfiles papers as Sources (route and published/preprint version recorded); connector results resolve through the shared resolver; OpenAlex and Unpaywall slots in Accounts.scient_sources_search, exact Sources PDF quotes, quote verification, and browser "Save to Library"..scient/annotations/v1/, agent read and write tools, and "Quote in my document".CLIENT_GUARDED_HTTP_SCOPES,createEnvironmentHttpCommand); read-only connections see the Library with change controls disabled. Server authorization is unchanged.⋯menu (Get missing PDFs, Check references, Systematic reviews, Export, Trash); the reference box no longer shifts Notes; the reference style picker opens on click; the search field reads "Search sources" so it fits narrow panes.try/finallyin render code, so the React Compiler optimizes them again (sharedsettleAfterhelper, as inFileRenameButton).accounts.papers.getForSource,accounts.papers.requestwithsourceorlibrary: true) needorchestration:operateon top ofsettings:write, the same as the Sources routes. One rule (scientPaperRequestScopes) serves the client command check and the server authorization; malformed requests fail closed.math.DG/0211159), Open Library authors listed twice, and Crossref titles with inline markup read as plain text. The contact email went only to Crossref, OpenAlex and Unpaywall.ef51507463is merged in; the only conflict was the measured budget file.mcpToolListJsonBytesis 108,692 against main's 85,930,codexAdditionalContextAllCapabilitiesBytes10,518 against 10,170,scientAwarenessAllCapabilitiesBytes4,940 against 4,592. The new tools' input schemas alone account for about 14 KB, so theagent-context-budgetcheck needs theagent-context-increaselabel.S1 commits (on
claude/sources-combined-20261110):e36d730419(identifier checks and credit),5458ffd9b5(trash, restore, revert, robust listing),511555a3f7(contact email, PDF dates),69ae7720d8(retraction status, re-checks),d9ac2048cb(import-summary dismiss, review leftovers),afcbbc516b(tool-count test),151a59517e(review fixes: unsafe JSON guard, permanent delete revision check under the lock).Verification
Final gate on the combined branch (macOS, Apple Silicon), at
e5c6034f40and again after the last fixes atfffa6a6a66. After that, the head changes only work-log label wording the Accounts seam map (scient-accounts-seams.json, which classifies the two new files that read keys through Accounts) and one browser test that now calls the citation click handler directly instead of clicking by coordinates (it failed in a CI shard);packages/sharedtests, typecheck and the server tool-presentation tests were re-run on it.Re-gated at
6586b88e1f(paper-request permission and live-check fixes merged) andf3828bc76c(mainef51507463merged; this PR's tree):vp fmt --check,vp lint --report-unused-disable-directives,pnpm run typecheck,git diff --check, every package andapps/mobile/apps/desktoptest suite (exceptprovider-fx, below),apps/web(15,458 tests; two timing failures under load inExpandedImageDialogandMessagesTimeline, neither touched here, pass alone),pnpm run buildandpnpm run test:desktop-smoke: pass. The fullapps/serversuite was stopped twice on this machine by load; the files that failed before it stopped were rerun alone on Node 26.12.1.OverleafStateStoreandProjectionStorepass.AntigravityInstallation(case-insensitive APFS),GitVcsDriverCore(/private/var),LatexRealEngine(needs the source-navigation helper) and twoAcpAdapterV2terminal-output tests still fail locally; none of these files is touched by this PR, and the full server suite passed in CI on the previous head. CI qualifies this head.vp fmt --check,vp lint --report-unused-disable-directives,pnpm run typecheck,git diff --check,pnpm run build,pnpm run test:desktop-smoke: pass.packages/provider-fxskills.test.ts(2 tests; macOS/varvs/private/varpaths; untouched by this branch).apps/web(15,451 tests): pass apart from timing flakes under full-suite load that pass when rerun alone (useInlineActionConfirmin the first run,localApiin the second; neither file is touched). The full gate found 9 React Compiler coverage failures in Sources files; they are fixed here.apps/server(15,959 tests): the full gate found one Sources failure, the missing work-log names, now fixed. Six other failures are environment-specific and reproduce on a clean checkout of main9166d249c3:ProjectionStoreSQL window,AntigravityInstallation,ProviderManagedExecution,GitVcsDriverCore(/private/var),LatexRealEngine(needs the source-navigation helper) andEnvironmentFileOpen(macOS file-watch timing; fails 8/8 on main when run alone).reviews/sources-roadmap-20261110/reviews/.Documentation impact
Updated:
docs/user/sources.md,docs/internals/scient-sources.md.Model and harness
Streams built by Claude Opus 5.5 in Claude Code (Scient) and reviewed by Codex gpt-6.1-sol, screens reviewed by Codex gpt-6.1-terra; orchestrated by Claude Opus 5.5 in Factory Droid, then in Claude Code (Scient). PR 1 by Claude in Factory Droid.
🤖 Generated with Claude Code