Skip to content

feat(update): process moved repository commits with context update --pending (0.7.88) - #89

Merged
qiansc merged 3 commits into
mainfrom
feat/source-update-pending
Oct 28, 2026
Merged

qiansc merged 3 commits into
mainfrom
feat/source-update-pending

Conversation

@qiansc

@qiansc qiansc commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Moving a repository registration with context source add repo --ref <sha> only changes the registration. Until now, nothing processed the new commit. The next production or verify reported every cited region whose text moved or changed, so a routine re-pin produced dozens of warnings and no direct way to settle them. This PR makes the update a single, routed step:

  • context update --pending finds registered repositories whose commit moved past the processed version recorded for approved knowledge. It needs no input file.
    • It prepares the usual source update. Only pages whose cited text changed are candidates, listed in the new changed_references (changed or unavailable). The list can be empty.
    • The scope decision (scope_summary, new_topics) is still required, so additions and shared dependencies are reviewed before the baseline advances. Moved citations update their locations when the update settles.
  • Workflow route. A new process-source-update node (sources.update_pending, reason route.source.update-pending) runs the command before the idle reopen-cleared-task gate. The procedure is a recommended read, not a required one.
  • CLI guidance. source add repo returns a next hint when the moved commit leaves processed knowledge behind. verify warnings name context update --pending when a cited repository moved.
  • Shallow and partial checkouts. Settled-commit history reads share one reader per inspection, check each commit once, fetch a missing commit once (--depth=1) and read one file at a time per checkout. Recovered checkouts no longer misreport moved citations as changed. Large updates no longer trip remote rate limits.

Local verification

  • Community portal (Context 3b0ce0a/dabfa49 → ef395ea): verify reported 35 issues before. update --pending asked about 8 pages (19 citations); the moved citations elsewhere relocated at settlement. After review and build, verify reports 0 issues with both this build and the released 0.7.87.
  • Internal workspace (TTKB 119645f → 3d6eb3d): there were 60 warnings before. update --pending now finishes in under a minute, with 21 candidate pages and 52 genuinely changed citations. The earlier attempt reported 64 unavailable because of rate limiting and a processed commit missing from the remote. The content revisions are not part of this PR.

Tests

  • New projectPendingSourceUpdate.test.ts:
    • only moved citations plus a new export still require the scope decision, and the baseline holds until it is submitted;
    • candidates are limited to changed citations;
    • concurrent history reads in a shallow checkout share one fetch and confirm every moved citation (this test fails on the previous reader handling);
    • a missing commit is fetched into a shallow checkout.
  • Workflow fixture source-update-pending.yaml; existing fixtures carry update_pending: false.
  • Related tests pass locally (pending update, settled-reference relocation, knowledge update: 27 tests); typecheck and lint are clean. The full suite runs in CI.

🤖 Generated with Claude Code

qiansc and others added 3 commits October 28, 2026 04:06
…pending

Moving a registration with source add repo --ref left approved knowledge
processed at the old commit, and verify then reported every moved or
changed citation. context update --pending now processes those sources:
unchanged or moved citations settle at the new commit, and only pages
whose cited text changed become candidates, listed in changed_references.

A workflow node (sources.update_pending) routes to the command before the
idle task gate; source add repo and verify point to it. History reads for
settled commits check each commit once, fetch a missing one into shallow
or partial checkouts, and read one file at a time per checkout.

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

context update --pending no longer settles a moved commit on its own when
every citation is unchanged or only moved: matching cited text proves a
citation can relocate, not that additions or shared dependencies are
covered. It always prepares the source update, with only changed pages as
candidates, and the commit settles after the scope decision.

Concurrent references during one inspection now share one history reader,
so a shallow checkout fetches a missing commit once and every moved
citation is confirmed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qiansc
qiansc merged commit 1f03044 into main Oct 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