Skip to content

Context 0.7.108: batch refreshes record one version; verified repository registrations - #121

Merged
qiansc merged 5 commits into
mainfrom
fix/0.7.107-remote-findings
Nov 30, 2026
Merged

qiansc merged 5 commits into
mainfrom
fix/0.7.107-remote-findings

Conversation

@qiansc

@qiansc qiansc commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Background

A real remote-mode documentation update on 0.7.107 (two batches by requirement) exposed friction in batch refreshes and repository registration.

Changes

  • context update --input accepts more_batches: true: a batch followed by another builds without recording the workspace version; the last batch records it once. Guidance explains the version base when earlier batches were committed separately.
  • context source add repo verifies the commit before registering: local mode checks the checkout and fetches the commit from origin once; remote/auto mode confirms it through Sourcegraph (readable, or the head of a remote branch or tag) and otherwise refuses unless --allow-unverified-ref.
  • Sources skipped in remote mode are reported only in skipped_sources, not in outside_scope/expand_scope, and do not change the update revision.
  • Remote mode no longer suggests restoring local checkouts.
  • Version 0.7.108 and CHANGELOG.

Risks

Registration now refuses unknown commits; --allow-unverified-ref keeps the old behaviour for an unusual older commit.

Compatibility

more_batches and --allow-unverified-ref are optional; without them behaviour matches 0.7.107 except the added commit check.

Testing

Build, typecheck and lint pass; new and existing tests of the touched modules pass per file; remote-mode registration was checked against a real Sourcegraph site.

🤖 Generated with Claude Code

qiansc and others added 5 commits November 29, 2026 18:55
…d commits; keep skipped sources out of scope expansion

- A source update input may set more_batches: true. Its revision batch
  is reviewed, closed and built as usual, but the Route does not ask for
  a workspace version, so the next batch can start right after the build;
  the last batch records the one version of the whole refresh. The flag
  follows the update's later pages as version_deferred.
- context source add repo rejects a commit that neither the checkout nor
  its origin (fetched once) has. With a remote source mode, Sourcegraph is
  asked instead; a commit it cannot read yet gets a warning, because it
  answers the same for an unprepared and a nonexistent commit, and the
  returned status carries no checkout advice.
- A cited source outside the update that remote mode cannot read is listed
  in skipped_sources only, not in outside_scope or expand_scope, so the
  update request is the same as with a readable checkout.
- Guidance: refresh batches set more_batches until the last one, which
  records the version once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tering

In a remote source mode, context source add repo now checks the commit
before writing sources/repo/index.yaml: it registers a commit Sourcegraph
can read, or one that a remote branch or tag points at (from the refs
catalog, with a brief retry while the catalog is prepared), the latter
with an info that update --pending can prepare it. Anything else, including
a missing token or an unreachable site, is refused without checkout hints;
a missing authorization reports the top-level source_authorization step.
--allow-unverified-ref registers such a commit with a warning, for example
an older commit no branch or tag points at. Local mode is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… mode

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ped scopes

- Auto mode keeps the reason code when it falls back to the checkout, so
  source add repo also checks remote branch and tag heads there, and its
  refusal carries no checkout fallback text.
- An in-scope source remote mode skips is filtered out of outside_scope
  and expand_scope like an out-of-scope one.
- The refs check makes three requests at most while the catalog is being
  prepared, clears a rejected temporary token and asks for authorization,
  treats a truncated catalog or a repeating cursor as unverified, and
  reads the catalog state from the response.
- Guidance: the last batch of a committed multi-batch refresh inspects and
  records the version against the commit before the first batch when the
  workspace has no version tag.
- Comment fixes in repoSources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qiansc
qiansc merged commit faab591 into main Nov 30, 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