Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to Context are documented here.

## 0.7.90 - 2026-10-28

- A `context update --pending` decision can now revise existing pages whose citations did not change. The update lists them in `scope_pages`; they need no decision, but when an addition or a shared change affects one, include it with an `instruction`. Previously only pages with changed citations could be submitted, so such a page was rejected as not a candidate.

## 0.7.88 - 2026-10-28

- `context update --pending` processes registered repositories whose commit moved past the version approved knowledge was processed at, such as after `context source add repo --ref <sha>`. Only pages whose cited text changed become update candidates, listed with their sections in `changed_references`; the update still asks for one scope decision covering additions and shared dependencies, and the new commit settles, with moved citations updating their locations, only after that decision. The workspace Route runs it before the idle task gate, `source add repo` returns a `next` hint for it, and `verify` warnings point to it when a cited repository moved.
Expand Down
30 changes: 15 additions & 15 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "context",
"version": "0.7.88",
"version": "0.7.90",
"packageManager": "bun@1.3.9",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/context-cli/context-workflow/provider.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
schema: agent-graph.provider.v1
id: c4a/context
version: 0.7.88
version: 0.7.90
name: Context workflow
description: Internal work contract for Context knowledge workspaces.
graphs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ Moving a repository with `context source add repo --ref <sha>` only changes its
registration. When approved knowledge was processed at the previous commit, run
`context update --pending --format json`. Only pages whose cited text changed
become candidates, listed in `changed_references`; still inspect the change for
additions and shared dependencies before deciding. Moved citations update their
additions and shared dependencies before deciding. Other pages citing the source
are listed in `scope_pages` and can be revised in the same decision. Moved citations update their
locations when the update settles.

Before importing a `note`, read [note source preparation](note.md).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ Moving a repository with `context source add repo --ref <sha>` only changes its
registration. When approved knowledge was processed at the previous commit, run
`context update --pending --format json`. Only pages whose cited text changed
become candidates, listed in `changed_references`; still inspect the change for
additions and shared dependencies before deciding. Moved citations update their
additions and shared dependencies before deciding. Other pages citing the source
are listed in `scope_pages` and can be revised in the same decision. Moved citations update their
locations when the update settles.

Before importing a `note`, read [note source preparation](note.md).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ cited text changed (`changed`) or could not be read (`unavailable`, such as a
renamed or deleted file). For `context update --pending`, pages whose citations
are unchanged or only moved are not candidates, so an empty list is possible;
still check the change for additions before submitting the scope decision.
Those pages are listed in `scope_pages`: they need no decision, but include one
with an `instruction` when an addition or shared change affects it.

Also inspect additions and shared dependencies in the source change. Existing
page references cannot discover every new topic. List necessary new pages in `new_topics`, each with a readable `path` in an existing
Expand Down
2 changes: 1 addition & 1 deletion packages/context-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/context-cli",
"description": "Local runtime and Agent integration for traceable knowledge production",
"version": "0.7.88",
"version": "0.7.90",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { beginKnowledgeUpdate, readKnowledgeUpdate } from "../project/knowledgeU
import { pendingSourceUpdateScopes } from "../project/pendingSourceUpdates.js";
import { registeredRepoHistoryReader } from "../project/articleSourceReader.js";
import { collectProjectStatus } from "../project/status.js";
import { readApprovedRevision } from "../project/approvedRevision.js";

const roots: string[] = [];
afterEach(async () => { for (const root of roots.splice(0)) await rm(root, { recursive: true, force: true }); });
Expand Down Expand Up @@ -73,6 +74,22 @@ test("a pending update with only moved citations still requires the scope decisi
expect(await pendingSourceUpdateScopes(root)).toEqual([]);
});

test("the scope decision can revise an existing page whose citations are unchanged", async () => {
const root = await settledKnowledge();
const before = await baseline(root);
await moveCitedTextAndAddExport(root);
await beginKnowledgeUpdate(root, undefined, { pending: true });
const update = (await readKnowledgeUpdate(root))!;
expect(update.candidates).toEqual([]);
expect(update.scope_pages).toEqual(["architecture/overview.md", "architecture/usage.md"]);
const status = await collectProjectStatus(root, { managed: true });
expect(await completeCurrentIndexerAction({ cwd: root, revision: status.workflow.current!.revision, managed: true,
value: { stage: "source-update", decisions: [{ path: "architecture/overview.md", instruction: "Mention newPublicFeature." }],
scope_summary: "The overview introduces the new export.", new_topics: [] } })).toMatchObject({ outcome: "revisions-prepared" });
expect((await readApprovedRevision(root))?.target.path).toBe("architecture/overview.md");
expect(await baseline(root)).toEqual(before);
});

test("concurrent history reads in a shallow checkout share one fetch and confirm every moved citation", async () => {
const root = await settledKnowledge();
const source = join(root, "fixture-source");
Expand Down
2 changes: 1 addition & 1 deletion packages/context-cli/src/project/indexerBaseContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { bundledMarkdownReaderQuestionContracts } from
"./indexerBaseMarkdownAuthoringCatalog.js";

const BASE_CONTRACT_VERSION = "1.1.0";
export const BUNDLED_INDEXER_PARSER_PACKAGE_VERSION = "0.7.88";
export const BUNDLED_INDEXER_PARSER_PACKAGE_VERSION = "0.7.90";
const BUNDLED_PARSER_REQUIREMENTS = buildIndexerParserCapabilityRequirements(
BUNDLED_INDEXER_PARSER_PACKAGE_VERSION,
);
Expand Down
10 changes: 8 additions & 2 deletions packages/context-cli/src/project/knowledgeUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const updateSchema = z.object({
structure_proposal: indexerCurrentActionInputDefinitions.sourceUpdate.omit({ stage: true }).optional(),
previous_versions: z.array(z.string().nullable()), changes: z.string().optional(),
repo_content: z.unknown().optional(),
scope_pages: z.array(z.string()).optional(),
changed_references: z.array(z.object({ path: z.string(), section_id: z.string(), state: z.enum(["changed", "unavailable"]),
source_ref: z.string(), locator: z.unknown() }).strict()).optional(),
}).strict();
Expand Down Expand Up @@ -90,6 +91,9 @@ export async function beginKnowledgeUpdate(projectRoot: string, value: unknown,
view_ref: article.article_id,
source_refs: [...new Set(article.sections.flatMap(section => section.references.map(reference => reference.source_ref)))] };
}));
// Pending updates ask only about changed citations, but the scope review may
// still revise any existing page that cites these sources.
const scopePages = options.pending ? cited.map(article => article.path).filter(path => !changedPaths.has(path)) : [];
const registry = await readProductionRequirements(projectRoot);
const repoReferences = articles.flatMap(article =>
article.sections.flatMap(section => section.references.filter(ref => ref.source_ref.startsWith("repo-content:") &&
Expand All @@ -104,6 +108,7 @@ export async function beginKnowledgeUpdate(projectRoot: string, value: unknown,
const requirements = registry.requirements.filter((requirement) => requirementIds.has(requirement.id));
const payload = { protocol: "context.source-update/v1" as const, scopes, requirements, candidates,
...(repoContent === undefined ? {} : { repo_content: repoContent }),
...(scopePages.length === 0 ? {} : { scope_pages: scopePages }),
...(inspected.unresolved.length === 0 ? {} : { changed_references: inspected.unresolved.map(item => ({ path: item.path,
section_id: item.section_id, state: item.state, source_ref: item.reference.source_ref, locator: item.reference.locator })) }),
previous_versions: scopes.map((scope) => processedVersionForScope(settled, scope) ?? null),
Expand Down Expand Up @@ -178,12 +183,13 @@ export async function completeKnowledgeUpdate(input: { projectRoot: string; revi
if (repeated.length) throw new SubmissionInputError(`Update page paths must be unique; repeated: ${repeated.join(", ")}`, ["decisions"]);
const candidates = new Set(request.candidates.map((candidate) => candidate.path));
const missing = [...candidates].filter((path) => !input.decisions.some((decision) => decision.path === path));
const unknown = input.decisions.map((decision) => decision.path).filter((path) => !candidates.has(path));
const scopePages = new Set(request.scope_pages ?? []);
const unknown = input.decisions.map((decision) => decision.path).filter((path) => !candidates.has(path) && !scopePages.has(path));
if (missing.length || unknown.length) {
throw new SubmissionInputError([
"Decide each source-bound candidate once; an omitted page is not a no-change decision. List a candidate with only its path to keep it unchanged.",
...(missing.length ? [`Missing: ${missing.join(", ")}.`] : []),
...(unknown.length ? [`Not candidates (use new_topics for new pages): ${unknown.join(", ")}.`] : []),
...(unknown.length ? [`Not candidates or scope pages (use new_topics for new pages): ${unknown.join(", ")}.`] : []),
].join(" "), ["decisions"]);
}
await captureProcessedScopes(input.projectRoot, request.scopes);
Expand Down
3 changes: 2 additions & 1 deletion packages/context/docs/guides/knowledge-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ Moving a repository with `context source add repo --ref <sha>` only changes its
registration. When approved knowledge was processed at the previous commit, run
`context update --pending --format json`. Only pages whose cited text changed
become candidates, listed in `changed_references`; still inspect the change for
additions and shared dependencies before deciding. Moved citations update their
additions and shared dependencies before deciding. Other pages citing the source
are listed in `scope_pages` and can be revised in the same decision. Moved citations update their
locations when the update settles.

Before importing a `note`, read [note source preparation](note.md).
Expand Down
2 changes: 1 addition & 1 deletion packages/context/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/context",
"description": "Declarative SDK for Context knowledge sources, workflows, review, and package outputs",
"version": "0.7.88",
"version": "0.7.90",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/core",
"description": "Shared extraction types, schemas, and utilities for Context",
"version": "0.7.88",
"version": "0.7.90",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/dev-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/dev-cli",
"description": "Developer menu for Context build, verification, link, and release preparation",
"version": "0.7.88",
"version": "0.7.90",
"private": true,
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/extract-contract/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/extract-contract",
"description": "OpenAPI and GraphQL contract catalog adapter for Context",
"version": "0.7.88",
"version": "0.7.90",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extract-go/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/extract-go",
"description": "Go extraction plugin and structural index for Context",
"version": "0.7.88",
"version": "0.7.90",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extract-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/extract-mdx",
"description": "MDX component and example catalog bridge for Context",
"version": "0.7.88",
"version": "0.7.90",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extract-proto/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/extract-proto",
"description": "Protocol Buffers IDL catalog parser for Context",
"version": "0.7.88",
"version": "0.7.90",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extract-rush/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/extract-rush",
"description": "Rush workspace structural index for Context",
"version": "0.7.88",
"version": "0.7.90",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extract-sql/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/extract-sql",
"description": "Dialect-bound lightweight SQL evidence adapter for Context",
"version": "0.7.88",
"version": "0.7.90",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extract-style/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/extract-style",
"description": "Lightweight CSS and SCSS evidence adapter for Context",
"version": "0.7.88",
"version": "0.7.90",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extract-thrift/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/extract-thrift",
"description": "Apache Thrift IDL catalog parser for Context",
"version": "0.7.88",
"version": "0.7.90",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extract-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/extract-ts",
"description": "TypeScript and JavaScript extraction plugin for the Context ExtractionResult v2 contract",
"version": "0.7.88",
"version": "0.7.90",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
Loading
Loading