Skip to content

Context 0.7.106: read repository checkouts outside the workspace; batch source refreshes - #118

Merged
qiansc merged 2 commits into
mainfrom
feat/context-0.7.106
Nov 28, 2026
Merged

qiansc merged 2 commits into
mainfrom
feat/context-0.7.106

Conversation

@qiansc

@qiansc qiansc commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Release 0.7.106.

Background. During a refresh of a workspace with seven registered sources, every citation of one repository (677) was reported unavailable with source-path-outside-scope, including citations of files that did not change between the two commits. The registered local path was a symlink to an existing checkout outside the workspace, as context source restore binds it. The same refresh took six review rounds because the Agent applied "one new repository per stage" to already registered repositories and learned the corrections-only rule only after the first review.

Changes.

  • articleSourceReader.ts: repository citations and their history are read as Git objects of the registered commit, so the checkout's real path no longer has to be inside the workspace. The check that a cited path stays inside the repository is unchanged; captured documents and notes must still be inside the workspace. Root cause: the workspace check dated from when repository citations were read as files, while source restore accepts any existing checkout after verifying its remote and commit.
  • approvedRevisionReferences.ts: when a revision repeats an earlier citation's line numbers and the text there changed, kept-reference-unresolved says that the text changed and, when the new text occurs once in the file, gives the quote locator to submit. The meaning of repeated line numbers ("keep the earlier evidence") is unchanged.
  • Guidance only (no CLI change): a new "Refresh several registered sources" section in the knowledge-updates guide (read-only sizing with git diff --name-status, large repositories and monorepos in their own batch, the rest grouped by requirement, one context update --input per batch with repository and document scopes, --pending only for a repository-only batch), pointers from the context and context-plan Skills and the routine-update reference, the corrections-only rule in the source-update and approved-revision procedures, and a note that task adjust with refresh: true keeps a source update's computed citation results.

Compatibility

None for workspaces, snapshots, approved knowledge, package output, CLI JSON or SDK consumers. No new files, configuration or fields. Workspaces whose checkouts are inside the workspace behave as before; repositories behind a checkout outside the workspace become readable. The error text of kept-reference-unresolved changes; its reason code does not.

Risks. Repository reads now accept a checkout anywhere on the machine; they still read only Git objects of the registered, verified commit and reject paths outside the repository.

Verification

  • New tests in projectPendingSourceUpdate.test.ts: a checkout outside the workspace behind a symlinked local path — an update where only an uncited file changed reports no changed or unavailable citation; a changed citation reports its current text and history. Both fail on 0.7.105 with source-path-outside-scope and pass with this change.
  • approvedRevisionReferences.test.ts extended: the error gives the quote locator when the text is unique and names quote/heading locators otherwise.
  • 176 tests across 28 files that use the source reader, source updates, revision citations, verification and repository recovery pass; plugin, Skill and workflow resource tests (97 across 14 files) pass after build:workflow and build:plugin; typecheck and lint pass.
  • On a copy of the affected workspace, the same restore → source add repo --ref → update --pending sequence: 0.7.105 reported 677 unavailable citations; this change reports 51 changed citations with current and historical text and none unavailable.

Checklist

  • bun run verify:full passes.
  • Lifecycle changes include route and recovery tests.
  • Published package metadata and local pack behavior were checked when affected.
  • English and Simplified Chinese user documentation remain behaviorally equivalent.
  • Runtime code remains compatible with Node.js 20+.
  • No generated output, secrets, private sources, or local workspaces are included.

🤖 Generated with Claude Code

qiansc and others added 2 commits November 28, 2026 03:48
…tch source refreshes

- Repository citations and their history are read as Git objects of the
  registered commit, so a checkout bound through a symlinked local path
  outside the workspace no longer reports every citation as
  source-path-outside-scope.
- kept-reference-unresolved says the text at the repeated lines changed and
  offers a unique quote locator.
- Guidance: refresh several registered sources in batches by requirement,
  corrections-only updates, and task adjust refresh keeping computed results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qiansc
qiansc merged commit 3d08f2e into main Nov 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant